The CUNWKEY macro unwraps a wrapped key by creating a new object for a private or secret key.
The function is performed asynchronously if asynchronous function execution was specified for the task with C_Initialize.
A detailed description of the function of the CUNWKEY macro can be found in PKCS#11 V2.20: Cryptographic Token Interface Standard in section 11.14 “Key management functions” under “C_UnwrapKey”.
Macro | Operands |
CUNWKEY | MF=C / D / L / M / E ,VERSION=001 / 002 ,SESSION=<var: int:4> / <integer 0..2147483647> / 0 ,MECHAN=<var: pointer> / NULL ,KEK=<var: int:4> / <integer 0..2147483647> / 0 ,WRPDKEY=<var: pointer> / NULL ,WRPDLEN=<var: int:4> / <integer 0..2147483647> / 0 ,TEMPL=<var: pointer> / NULL ,COUNT=<var: int:4> / <integer 0..2147483647> / 0 ,BOID=<var: int:4> / 0 ,RPOSTAD=<var: pointer> / NULL ,RPOSTL=<integer 1..2> / <var: int:4> / 0 |
VERSION
specifies which version of the parameter area is to be generated. It is always advisable to use the latest version.
=001
This generates the format that was supported by CRYPT V1.0. This format only supports the parameters already known in CRYPT V1.0.
VERSION=001 is the default.
=002
This generates the format that is supported as of CRYPT V1.1.
SESSION
Session identifier
MECHAN
points to the key wrap mechanism
KEK
Handle of the unwrapping key
WRPDKEY
points to the wrapped key
WRPDLEN
Length of the wrapped key
TEMPL
points to the template for the new key
COUNT
Number of attributes in the template
BOID
Event identification
in the case of synchronous execution: BOID is not used.
in the case of asynchronous execution: Event identification to which the end of signal processing is signalled.
RPOSTAD
Postcode address
in the case of synchronous execution: RPOSTAD is not used.
in the case of asynchronous execution: specifies a field containing postcode information which is to be transferred to the corresponding program that issues the SOLSIG call (see also “Executive Macros” user guide [3]).
Length of postcode: 4 or 8 bytes
RPOSTL
Length of postcode
in the case of synchronous execution: RPOSTL is not used.
in the case of asynchronous execution: specifies the length of the postcode information in words (1 or 2).