Cryptoki: a cryptographic Token Interface


C_Sign uses the convention described in Section on producing output. The signing operation must have been initialized with C_SignInit



Download 360.55 Kb.
Page111/196
Date22.12.2023
Size360.55 Kb.
#63026
1   ...   107   108   109   110   111   112   113   114   ...   196
v201-95
pkcs11-base-v2.40-cos01
C_Sign uses the convention described in Section on producing output.
The signing operation must have been initialized with C_SignInit. A call to C_Sign always terminates the active signing operation unless it returns CKR_BUFFER_TOO_SMALL or is a successful call (i.e., one which returns CKR_OK) to determine the length of the buffer needed to hold the signature.
For most mechanisms, C_Sign is equivalent to a sequence of C_SignUpdate operations followed by C_SignFinal.
Return values: CKR_BUFFER_TOO_SMALL, CKR_CRYPTOKI_NOT_INITIALIZED, CKR_DATA_INVALID, CKR_DATA_LEN_RANGE, CKR_DEVICE_ERROR, CKR_DEVICE_MEMORY, CKR_DEVICE_REMOVED, CKR_FUNCTION_CANCELED, CKR_FUNCTION_FAILED, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_OK, CKR_OPERATION_NOT_INITIALIZED, CKR_SESSION_CLOSED, CKR_SESSION_HANDLE_INVALID.
Example: see C_SignFinal for an example of similar functions.
  • C_SignUpdate


CK_DEFINE_FUNCTION(CK_RV, C_SignUpdate)(
CK_SESSION_HANDLE hSession,
CK_BYTE_PTR pPart,
CK_ULONG ulPartLen
);
C_SignUpdate continues a multiple-part signature operation, processing another data part. hSession is the session’s handle, pPart points to the data part; ulPartLen is the length of the data part.
The signature operation must have been initialized with C_SignInit. This function may be called any number of times in succession. A call to C_SignUpdate which results in an error terminates the current signature operation.
Return values: CKR_CRYPTOKI_NOT_INITIALIZED, CKR_DATA_LEN_RANGE, CKR_DEVICE_ERROR, CKR_DEVICE_MEMORY, CKR_DEVICE_REMOVED, CKR_FUNCTION_CANCELED, CKR_FUNCTION_FAILED, CKR_GENERAL_ERROR, CKR_HOST_MEMORY, CKR_OK, CKR_OPERATION_NOT_INITIALIZED, CKR_SESSION_CLOSED, CKR_SESSION_HANDLE_INVALID.
Example: see C_SignFinal.
  • C_SignFinal


CK_DEFINE_FUNCTION(CK_RV, C_SignFinal)(
CK_SESSION_HANDLE hSession,
CK_BYTE_PTR pSignature,
CK_ULONG_PTR pulSignatureLen
);
C_SignFinal finishes a multiple-part signature operation, returning the signature. hSession is the session’s handle; pSignature points to the location that receives the signature; pulSignatureLen points to the location that holds the length of the signature.

Download 360.55 Kb.

Share with your friends:
1   ...   107   108   109   110   111   112   113   114   ...   196




The database is protected by copyright ©ininet.org 2024
send message

    Main page