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.
DESCRIPTIONThis 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 VALUEA CSSM_RETURN value indicating success or specifying a particularerror condition. The value CSSM_OK indicates success. All othervalues represent an error condition. SEE ALSOBooks