def __init__(self, spa_data=None, key=None): """Constructor for the Fko class. Creates and intitializes the fko context. If no arguments are given, and empty context is create with some default values. See the libfko documentation for details on these defaults. If spa_data and key is supplied, the context is created, then the SPA data is decrypted using the key. If successful, the SPA data is parsed into the context's data structure. If spa_data is supplied without the key, then the encrypted data is stored in the context and can be decoded later (see libfko docs). """ # If there is SPA data, attempt to process it. Otherwise, create # an empty context. # if spa_data != None: self.ctx = _fko.init_ctx_with_data(spa_data, key) else: self.ctx = _fko.init_ctx()