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


CSSM_CSP_CreateAsymmetricContext

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

On z/OS, when any CSSM_CSP_CreateAsymmetricContext operation is invoked, a copy of the context is created. The pointer to the copy is returned on all CSSM_GetContext calls.

Purpose

This function creates an asymmetric encryption cryptographic context and returns the cryptographic context handle. The handle can be used to call asymmetric encryption functions and cryptographic wrap/unwrap functions.

Format

CSSM_CC_HANDLE CSSMAPI CSSM_CSP_CreateAsymmetricContext
                  (CSSM_CSP_HANDLE CSPHandle,
                  uint32 AlgorithmID,
                  const CSSM_CRYPTO_DATA_PTR PassPhrase,
                  const CSSM_KEY_PTR Key,
                  uint32 Padding)

Parameters

Input

CSPHandle
The handle that describes the CSP module used to perform this function. If a NULL handle is specified, OCSF returns an error.
AlgorithmID
The algorithm identification number for the algorithm used for asymmetric encryption.
PassPhrase
The passphrase is required to unlock the private key. The passphrase structure accepts an immediate value for the passphrase or the caller can specify a callback function the CSP can use to obtain the passphrase. The passphrase is needed only for signature operations, not verify operations. When the context is used for a wrap or unwrap operation, the passphrase can be used to generate a symmetric key for wrapping or unwrapping.
Key
The key used for asymmetric encryption. The caller passes a pointer to a CSSM_KEY structure containing the key. When the context is used for a sign operation, the public key and passphrase are required to access the private key used for signing. When the context is used for a verify operation, the public key is used to verify the signature. When the context is used for a wrapkey operation, the public key can be used as the wrapping key. When the context is used for an unwrap operation, the public key and the passphrase can be used to access the private key used to perform the unwrapping.

Input/optional

Padding
The method for padding. Typically specified for ciphers that pad.

Return Value

Returns a cryptographic context handle. If the handle is NULL, an error has occurred. Use CSSM_GetError to obtain the error code.

Related Information

CSSM_EncryptData
CSSM_QuerySize
CSSM_EncryptDataInit
CSSM_EncryptDataUpdate
CSSM_EncryptDataFinal
CSSM_DecryptData
CSSM_DecryptDataInit
CSSM_DecryptDataUpdate
CSSM_DecryptDataFinal
CSSM_GetContext
CSSM_SetContext
CSSM_DeleteContext
CSSM_GetContextAttribute
CSSM_UpdateContextAttributes

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014