Previous section.

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

NAME

CSP_QuerySize

SYNOPSIS

CSSM_RETURN CSSMSPI CSP_QuerySize
    (CSSM_CSP_HANDLE CSPHandle,
    CSSM_CC_HANDLE CCHandle,
    const CSSM_CONTEXT_PTR Context,
    CSSM_BOOL Encrypt,
    uint32 QuerySizeCount,
    CSSM_QUERY_SIZE_DATA_PTR DataBlock)

DESCRIPTION

This function queries for sizes of output data blocks for encryption and decryption operations. The Encrypt flag specifies the encryption or the decryption operation. The input sizes are specified in the DataBlock structures. The corresponding output size are returned in the DataBlock structures. Multiple input block sizes can be specified in a single call.

This function can also be used to query the output size requirements for the intermediate steps of a staged cryptographic operation (for example, CSP_EncryptDataUpdate and CSP_DecryptDataUpdate). There may be algorithm-specific and token-specific rules restricting the lengths of data following data update calls.

PARAMETERS

CSPHandle (input)

The handle that describes the add-in cryptographic service provider module used to perform up calls to CSSM for the memory functions managed by CSSM.

CCHandle (input)

The handle that describes the context of this cryptographic operation used to link to the CSP-managed information.

Context (input)

Pointer to CSSM_CONTEXT structure that describes the attributes with this context.

Encrypt (input)

This parameter describes the SizeInputBlock in DataBlock is for encryption or decryption.

QuerySizeCount (input)

This parameter describes number of DataBlocks.

DataBlock (input/output)

Pointer to a CSSM_QUERY_SIZE_DATA structure which contains one SizeInputBlock and one SizeOutputBlock. The function returns the size of the output in bytes in SizeOutputBlock for the size of the input.

RETURN VALUE

A CSSM return value. This function returns CSSM_OK if successful and returns an error code if an error has occurred.

ERRORS

CSSM_CSP_INVALID_CSP_HANDLE

Invalid CSP handle.

CSSM_CSP_INVALID_CONTEXT_HANDLE

Invalid context handle.

CSSM_CSP_INVALID_CONTEXT_POINTER

Invalid CSSM_CONTEXT pointer.

CSSM_CSP_INVALID_CONTEXT

Context type and operation do not match.

CSSM_CSP_INVALID_POINTER

Invalid output query size data pointer.

CSSM_CSP_INVALID_ALGORITHM

Unknown algorithm.

CSSM_CSP_OPERATION_UNSUPPORTED

Query size service not supported.

CSSM_CSP_OPERATION_FAILED

Query size operation failed.

CSSM_CSP_INVALID_PADDING

Unknown padding.

CSSM_CSP_INVALID_MODE

Unknown algorithm mode for symmetric context.

CSSM_CSP_INVALID_ATTR_PASSPHRASE

Invalid or missing passphrase attribute in the asymmetric context.

CSSM_CSP_QUERY_SIZE_UNKNOWN

Cannot determine size of output data blocks.

SEE ALSO

CSP_EncryptData, CSP_EncryptDataUpdate,
CSP_DecryptData, CSP_DecryptDataUpdate,
CSP_SignData, CSP_VerifyData,
CSP_DigestData, CSP_GenerateMac

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