コード例 #1
0
def buildAuthenticateParam(self, res_msg):
        '''
           This will build the authentication get message to be sent to the called page,
           all data needs to be encrypted
           this will encrypt the token and auth details and form as string and returns
           @param res_msg: Auth Dictionary
           @return: A string containing the authentication details as Get Parameter
        '''
        from django.conf import settings
        PRV_ENC_KEY = getattr(settings, "PRV_ENC_KEY", 'n');
        from ui_utilities.dsutilities import DSUtility
        # First AUth ID
        auth_id = DSUtility().getlistitem(res_msg, 'authid');
        from encryption.uiencrypt import EncryptionUtil
        authIdApi = EncryptionUtil(PRV_ENC_KEY);
        auth_id = authIdApi.encryptText(auth_id);
        # Second Prev AUth ID
        prv_auth_id = DSUtility().getlistitem(res_msg, 'prvauthid');
        prv_auth_id = authIdApi.encryptText(prv_auth_id);
        
        # 3 Token
        token = DSUtility().getlistitem(res_msg, 'token');
        token = authIdApi.encryptText(token);
        # 4 Prev Token
        prv_token = DSUtility().getlistitem(res_msg, 'prvtoken');
        prv_token = authIdApi.encryptText(prv_token);
        # 5 Profile ID
        prf_id = DSUtility().getlistitem(res_msg, 'prfid');
        prf_id = authIdApi.encryptText(prf_id);
        
        return 'au=%s&pau=%s&tn=%s&ptn=%s&pi=' %(auth_id, prv_auth_id, token, prv_token, prf_id);   
コード例 #2
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testEncryptionDefault(self):
     '''
        This will test for the default encryption
     '''
     api = EncryptionUtil()
     print "%s" % (api.encryptText())
     self.assertTrue(True, 'true')
コード例 #3
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testEncryptionDefault(self):
     '''
        This will test for the default encryption
     '''
     api = EncryptionUtil()
     print "%s" %(api.encryptText())
     self.assertTrue(True, 'true')
コード例 #4
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePubProfileId(self):
     api = EncryptionUtil(self.PUB_PRF_ID_ENC_KEY)
     print 'public profile id- %s' % (api.encryptText('123'))
コード例 #5
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePrivateToken(self):
     api = EncryptionUtil(self.PRV_ENC_KEY)
     print 'private toekn- %s' % (api.encryptText('abc'))
コード例 #6
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePubToken(self):
     api = EncryptionUtil(self.PUB_ENC_KEY)
     print 'public token- %s' % (api.encryptText('abc'))
コード例 #7
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testgenratepwd(self):
     '''
        This will genrate the password key
     '''
     api = EncryptionUtil(self.PASSWORD_KEY)
     print 'pwdt- %s' % (api.encryptText('test'))
コード例 #8
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePubProfileId(self):
     api = EncryptionUtil(self.PUB_PRF_ID_ENC_KEY)
     print 'public profile id- %s' %(api.encryptText('123'))
コード例 #9
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePrivateToken(self):
     api = EncryptionUtil(self.PRV_ENC_KEY)
     print 'private toekn- %s' %(api.encryptText('abc'))
コード例 #10
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testGenratePubToken(self):
     api = EncryptionUtil(self.PUB_ENC_KEY)
     print 'public token- %s' %(api.encryptText('abc'))
コード例 #11
0
ファイル: tests.py プロジェクト: jayarampradhan/uimirror_py
 def testgenratepwd(self):
     '''
        This will genrate the password key
     '''
     api = EncryptionUtil(self.PASSWORD_KEY)
     print 'pwdt- %s' %(api.encryptText('test'))