Example #1
0
    def import_public_key(self, source, data):
        params = ldap2p11helper_api_params(source)
        # filter out params inappropriate for public keys
        for par in set(params.keys()).difference(public_key_api_params):
            del params[par]
        params['data'] = data

        h = self.p11.import_public_key(**params)
        return Key(self.p11, h)
Example #2
0
    def import_public_key(self, source, data):
        params = ldap2p11helper_api_params(source)
        # filter out params inappropriate for public keys
        for par in set(params).difference(public_key_api_params):
            del params[par]
        params['data'] = data

        h = self.p11.import_public_key(**params)
        return Key(self.p11, h)
Example #3
0
    def import_private_key(self, source, data, unwrapping_key):
        params = ldap2p11helper_api_params(source)
        # filter out params inappropriate for private keys
        for par in set(params.keys()).difference(private_key_api_params):
            del params[par]
        params['data'] = data
        params['unwrapping_key'] = unwrapping_key.handle

        h = self.p11.import_wrapped_private_key(**params)
        return Key(self.p11, h)
Example #4
0
    def import_private_key(self, source, data, unwrapping_key):
        params = ldap2p11helper_api_params(source)
        # filter out params inappropriate for private keys
        for par in set(params).difference(private_key_api_params):
            del params[par]
        params['data'] = data
        params['unwrapping_key'] = unwrapping_key.handle

        h = self.p11.import_wrapped_private_key(**params)
        return Key(self.p11, h)