keychain-uses-objects
quadrismegistus 4 years ago
parent 5bc39be841
commit 25ad7d1b86

@ -37,14 +37,12 @@ class KomradeSymmetricKey(KomradeKey):
self._cell = SCellSeal(key=self.key) self._cell = SCellSeal(key=self.key)
return self._cell return self._cell
def encrypt(self,msg,**kwargs): def encrypt(self,msg,**kwargs):
if issubclass(type(msg), KomradeKey) or issubclass(type(msg),KomradeEncryptedKey): if hasattr(msg,'data'): msg=msg.data
msg=msg.data
print('??? dec',msg,kwargs) print('??? dec',msg,kwargs)
return self.cell.encrypt(msg,**kwargs) return self.cell.encrypt(msg,**kwargs)
def decrypt(self,msg,**kwargs): def decrypt(self,msg,**kwargs):
if issubclass(type(msg), KomradeKey) or issubclass(type(msg),KomradeEncryptedKey): if hasattr(msg,'data'): msg=msg.data
msg=msg.data
print('??? dec',msg,kwargs) print('??? dec',msg,kwargs)
try: try:

Loading…
Cancel
Save