blob: 45da0de2bc0cbcf6602eabfb00a4f4a4d7ffebaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
'''
Created on Oct 27, 2011
@author: steger, jozsef
@organization: ELTE
@contact: steger@complex.elte.hu
'''
class Credential(object):
'''
@summary: an empty credential to serve as an ancient class
@author: steger, jozsef
'''
pass
class UsernamePassword(Credential):
'''
@summary: container for a pair of user name and password
@author: steger, jozsef
@ivar username: name of the user
@type username: str
@ivar password: password secret
@type password: str
'''
def __init__(self, username, password):
'''
@summary: Constructor
@param username: the username
@type username: string
@param password: the password
@type password: string
'''
self.username = username
self.password = password
class UsernameRSAKey(Credential):
'''
@summary: container for a triple of user name, private key and an optional password for the key
@author: steger, jozsef
@ivar username: name of the user
@type username: str
@ivar rsakey: a file name pointing to the user's private key secret
@type rsakey: str
@ivar password: password secret
@type password: str
'''
def __init__(self, username, rsakey, password = ""):
'''
@summary: Constructor
@param username: the username
@type username: string
@param rsakey: the private key file
@type rsakey: string
@param password: the optional password to unlock the private key, default: ""
@type password: string
'''
self.username = username
self.rsakey = rsakey
self.password = password
|