diff options
-rw-r--r-- | pskc/encryption.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pskc/encryption.py b/pskc/encryption.py index 2c06ae6..b310715 100644 --- a/pskc/encryption.py +++ b/pskc/encryption.py @@ -71,14 +71,17 @@ class Encryption(object): """Class for handling encryption keys that are used in the PSKC file.""" def __init__(self, key_info=None): + self.id = None self.key_names = [] self.key = None - if key_info is not None: - self.parse(key_info) + self.parse(key_info) def parse(self, key_info): """Read encryption information from the EncryptionKey XML tree.""" from pskc.parse import g_e_v, namespaces + if key_info is None: + return + self.id = key_info.attrib.get('Id') for name in key_info.findall('ds:KeyName', namespaces=namespaces): self.key_names.append(g_e_v(name, '.')) |