INNER CODE UNIT · Python
BksSealedKeyEntry
kurtbrose/pyjks · jks/bks.py:137
class BksSealedKeyEntry(AbstractBksEntry):
"""
PBEWithSHAAnd3-KeyTripleDES-CBC-encrypted wrapper around a :class:`BksKeyEntry`. The contained key type is unknown until decrypted.
Once decrypted, objects of this type can be used in the same way as :class:`BksKeyEntry`: attribute accesses are forwarded
to the wrapped :class:`BksKeyEntry` object.
"""
def __init__(self, **kwargs):
super(BksSealedKeyEntry, self).__init__(**kwargs)
self._nested = None # nested BksKeyEntry once decrypted
def __getattr__(self, name):
if not self.is_decrypted():
raise NotYetDecryptedException("Cannot access attribute '%s'; entry not yet decrypted, call decrypt() with the correct password first" % name)
# if it's an attribute that exists here, return it; otherwise forward the request to the nested entry
if "_"+name in self.__dict__:
return self.__dict__["_"+name]
else: