z/OS Open Cryptographic Services Facility Application Programming
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF


CSSM_WrapKey

z/OS Open Cryptographic Services Facility Application Programming
SC24-5899-01

Purpose

This function wraps the supplied key using the context. The key may be a symmetric key or the public key of a public/private key pair. If a symmetric key is specified, it is wrapped. If a public key is specified, the passphrase is used to unlock the corresponding private key, which is then wrapped. When working with U.S. exportable versions of the OCSF, the caller may be required to possess specific exemptions or privileges in order to allow this call to complete successfully.

Format

CSSM_RETURN CSSMAPI CSSM_WrapKey 
              (CSSM_CC_HANDLE CCHandle, 
              const CSSM_CRYPTO_DATA_PTR PassPhrase,
              const CSSM_KEY_PTR Key,
              CSSM_WRAP_KEY_PTR WrappedKey)

Parameters

Input

CCHandle
The handle to the context that describes this cryptographic operation.
PassPhrase
The passphrase or a callback function to be used to obtain the passphrase that can be used by the CSP to unlock the private key before it is wrapped. This input is ignored when wrapping a symmetric, secret key.
Key
A pointer to the target key to be wrapped. If a private key is to be wrapped, the target key is the public key associated with the private key. If a symmetric key is to be wrapped, the target key is that symmetric key.

Output

WrappedKey
A pointer to a CSSM_WRAP_KEY_PTR structure that returns the wrapped key.

Return Value

CSSM_OK if the function was successful. CSSM_FAIL if an error occurred. Use CSSM_GetError to determine the exact error.

Related Information

CSSM_UnwrapKey
CSSM_RequestCssmExemption

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014