Previous section.

Common Security: CDSA and CSSM
Copyright © 1997 The Open Group

NAME

CSSM_CSP_CreateSignatureContext

SYNOPSIS

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

DESCRIPTION

This function creates a signature cryptographic context for sign and verify given a handle of a CSP, an algorithm identification number, a key, and a passphrase structure. The passphrase will be used to unlock the private key when this context is used to perform a signing operation. The cryptographic context handle is returned. The cryptographic context handle can be used to call sign and verify cryptographic functions.

PARAMETERS

CSPHandle (input)

The handle that describes the add-in cryptographic service provider module used to perform this function. If a NULL handle is specified, CSSM returns error.

AlgorithmID (input)

The algorithm identification number for a signature/verification algorithm.

PassPhrase (input)

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.

Key (input)

The key used to sign. The caller passes in a pointer to a CSSM_KEY structure containing the key and the key length.

RETURN VALUE

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

ERRORS

CSSM__INVALID_CSP_HANDLE

Invalid provider handle.

CSSM__MEMORY_ERROR

Internal memory error.

SEE ALSO

CSSM_SignData, CSSM_SignDataInit, CSSM_SignDataUpdate,
CSSM_SignDataFinal, CSSM_VerifyData, CSSM_VerifyDataInit,
CSSM_VerifyDataUpdate, CSSM_VerifyDataFinal,
CSSM_GetContext, CSSM_SetContext, CSSM_DeleteContext,
CSSM_GetContextAttribute, CSSM_UpdateContextAttributes

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.
You should also read the legal notice explaining the terms and conditions relating to the CDSA documentation.

Contents Next section Index