skip book previous and next navigation links
go up to top of book: HP Open Source Security for OpenVMS Volume 1:... HP Open Source Security for OpenVMS Volume 1:...
go to beginning of reference: API FunctionsAPI Functions
go to previous page: CSSM_CSP_CreateSignatureContextCSSM_CSP_CreateSignatureContext
go to next page: CSSM_CSP_GetLoginAclCSSM_CSP_GetLoginAcl
end of book navigation links


CSSM_CSP_CreateSymmetricContext
Library
Description
See Also
 Parameters
Return Value

NAME

CSSM_CSP_CreateSymmetricContext - Create a symmetric encryption cryptographic context (CDSA)

SYNOPSIS  

# include <cssm.h>

CSSM_RETURN CSSMAPI CSSM_CSP_CreateSymmetricContext(CSSM_CSP_HANDLE CSPHandle,CSSM_ALGORITHMS AlgorithmID,CSSM_ENCRYPT_MODE Mode,const CSSM_ACCESS_CREDENTIALS *AccessCred,const CSSM_KEY *Key,const CSSM_DATA *InitVector,CSSM_PADDING Padding,void *Reserved,CSSM_CC_HANDLE *NewContextHandle)


return to top LIBRARY  

Common Security Services Manager library (cdsa$incssm300_shr.exe)


return to top PARAMETERS  

CSPHandle (input)
 The handle that describes the add-in CryptographicService Provider module used to perform this function. If a NULLhandle is specified, CSSM returns error.
AlgorithmID (input)
 The algorithm identification number for symmetricencryption.
Mode (input) The mode of the specified algorithm ID.
AccessCred (input/optional)
 A pointer to the set of one or more credentialsrequired to unlock the private key. The credentials structure cancontain an immediate value for the credential, such as a passphrase,or the caller can specify a callback functionthe CSP can use to obtain one or more credentials. Credentials maybe required for encryption, decryption, and wrapping operations.
Key (input) The key used for symmetric encryption. The callerpasses a pointer to a CSSM_KEY structure containing the key.
InitVector (input/optional)
 The initial vector for symmetric encryption. Thisis typically specified for block ciphers.
Padding (input/optional)
 The method for padding. This is typically specifiedfor ciphers that pad.
Reserved (input)
 Reserved for future use.
NewContextHandle (output)
 Cryptographic context handle.


return to top DESCRIPTION  

This function creates a symmetric encryption cryptographiccontext, given a handle of a CSP, an algorithm identification number,a key, an initial vector, padding, and the number of encryptionrounds. Algorithm-specific attributes must be added to the contextafter the initial creation using the CSSM_UpdateContextAttributes() function. The cryptographic context handle is returned.The cryptographic context handle can be used to call symmetric encryptionfunctions and the cryptographic wrap or unwrap functions.

Additional attributes can be added to the newly created contextusing the CSSM_UpdateContextAttributes() function . Incremental attributes of interest when usingthis context to unwrap a key include a handle-pair identifying aData Storage Library service module and an open data store for CSPsthat manage multiple, persistent key stores. If a CSP does not supportmultiple key stores, the CSP ignores the presence or absence ofthis attribute.


return to top RETURN VALUE  

A CSSM_RETURN value indicating success or specifying a particularerror condition. The value CSSM_OK indicates success. All othervalues represent an error condition.


return to top SEE ALSO  

Books

Intel CDSA Application Developer's Guide

Online Help

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


go to previous page: CSSM_CSP_CreateSignatureContextCSSM_CSP_CreateSignatureContext
go to next page: CSSM_CSP_GetLoginAclCSSM_CSP_GetLoginAcl