summaryrefslogtreecommitdiffstats
path: root/Monitoring/src/main/python/Credential/credentialtypes.py
blob: 5af53b53f70347e0498f5cdc1a9a5532581450de (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
'''
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 
    '''

    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 
    '''

    def __init__(self, username, rsakey, password = ""):
        '''
        @summary: Constructor
        @param username: the username
        @type username: string
        @param rsakey: the private key
        @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