PyKCS11/__init__.py
def unwrapKey(self, unwrappingKey, wrappedKey, template,
                  mecha=MechanismRSAPKCS1):
        """
        C_UnwrapKey

        :param unwrappingKey: the unwrapping key handle
        :type unwrappingKey: integer
        :param wrappedKey: the bytes of the wrapped key
        :type wrappedKey:  (binary) string or list/tuple of bytes
        :param template: template for the unwrapped key
        :param mecha: the decrypt mechanism to be used (use
          `MechanismRSAPKCS1` for `CKM_RSA_PKCS`)
        :type mecha: :class:`Mechanism`
        :return: the unwrapped key object
        :rtype: integer

        """
        m = mecha.to_native()
        data1 = ckbytelist(wrappedKey)
        handle = PyKCS11.LowLevel.CK_OBJECT_HANDLE()
        attrs = self._template2ckattrlist(template)
        rv = self.lib.C_UnwrapKey(self.session, m, unwrappingKey,
                                  data1, attrs, handle)
        if rv != CKR_OK:
            raise PyKCS11Error(rv)
        return handle
def unwrapKey(self, unwrappingKey, wrappedKey, template,
                  mecha=MechanismRSAPKCS1):
        """
        C_UnwrapKey

        :param unwrappingKey: the unwrapping key handle
        :type unwrappingKey: integer
        :param wrappedKey: the bytes of the wrapped key
        :type wrappedKey:  (binary) string or list/tuple of bytes
        :param template: template for the unwrapped key
        :param mecha: the decrypt mechanism to be used (use
          `MechanismRSAPKCS1` for `CKM_RSA_PKCS`)
        :type mecha: :class:`Mechanism`
        :return: the unwrapped key object
        :rtype: integer

        """
        m = mecha.to_native()
        data1 = ckbytelist(wrappedKey)
        handle = PyKCS11.LowLevel.CK_OBJECT_HANDLE()
        attrs = self._template2ckattrlist(template)
        rv = self.lib.C_UnwrapKey(self.session, m, unwrappingKey,
                                  data1, attrs, handle)
        if rv != CKR_OK:
            raise PyKCS11Error(rv)
        return handle
def unwrapKey ( self , unwrappingKey , wrappedKey , template , mecha = MechanismRSAPKCS1 ) : m = mecha . to_native ( ) data1 = ckbytelist ( wrappedKey ) handle = PyKCS11 . LowLevel . CK_OBJECT_HANDLE ( ) attrs = self . _template2ckattrlist ( template ) rv = self . lib . C_UnwrapKey ( self . session , m , unwrappingKey , data1 , attrs , handle ) if rv != CKR_OK : raise PyKCS11Error ( rv ) return handle
C_UnwrapKey

        :param unwrappingKey: the unwrapping key handle
        :type unwrappingKey: integer
        :param wrappedKey: the bytes of the wrapped key
        :type wrappedKey:  (binary) string or list/tuple of bytes
        :param template: template for the unwrapped key
        :param mecha: the decrypt mechanism to be used (use
          `MechanismRSAPKCS1` for `CKM_RSA_PKCS`)
        :type mecha: :class:`Mechanism`
        :return: the unwrapped key object
        :rtype: integer
C_UnwrapKey