| RSA BSAFE Cert-C |
Certificate Components for C |
| Crypto-C 6.2.1 Developer's Guide | ||
| Search |
#include "bsafe.h"
#include "basetype.h"
#include "certpath.h"
#include "certext.h"
#include "certalg.h"
Go to the source code of this file.
Data Structures | |
| struct | CERT_IDENTIFIER |
| Identifies a certificate by the issuer name and serial number. More... | |
| struct | ISSUER_SERIAL_NUMBER |
| Uniquely identifies a certificate by the Distinguished Name (DN) of the certificate issuer and an issuer-specific certificate serial number. More... | |
| struct | KEY_TRANSPORT_INFO |
| Holds key transport information. More... | |
| struct | RECIPIENT_INFO |
| Holds message recipient information associated with a single recipient of a CMS message (supported) or a PKI message (deprecated). More... | |
| struct | SIGNER_INFO |
| Contains message signer information, including information associated with a single signer of a CMS message (supported) or a PKI message (deprecated). More... | |
Functions | |
| int | C_ReadMessageType (CERTC_CTX ctx, ITEM *cmsMsg, ITEM *oid) |
| Extracts the OID from a CMS-formatted message. More... | |
| int | C_WriteDataMsg (CERTC_CTX ctx, ITEM *data, ITEM *dataMsg) |
| Prepares a simple data message. More... | |
| int | C_WriteSignedDataMsg (CERTC_CTX ctx, CERT_PATH_CTX *pathCtx, SERVICE database, ITEM *data, UINT4 cmsOptions, LIST_OBJ certificates, LIST_OBJ crls, LIST_OBJ signers, ITEM *signedDataMsg) |
| Prepares a signed-data message. More... | |
| int | C_WriteEnvelopedDataMsg (CERTC_CTX ctx, SERVICE database, ITEM *data, ALGORITHM_IDENTIFIER *contentEncryptionAlgorithmId, LIST_OBJ recipientInfos, B_KEY_OBJ encryptionKey, POINTER reserved1, ATTRIBUTES_OBJ reserved2, ITEM *envelopedDataMsg) |
| Prepares an enveloped-data message. More... | |
| int | C_WriteDigestedDataMsg (CERTC_CTX ctx, ITEM *data, int digestAlgorithmId, ITEM *digestedDataMsg) |
| Prepares a digested data message. More... | |
| int | C_WriteEncryptedDataMsg (CERTC_CTX ctx, ITEM *data, ALGORITHM_IDENTIFIER *encryptAlgorithmId, B_KEY_OBJ encryptionKey, ATTRIBUTES_OBJ reserved, ITEM *encryptedDataMsg) |
| Prepares an encrypted data message. More... | |
| int | C_ReadDataMsg (CERTC_CTX ctx, ITEM *dataMsg, ITEM *data) |
| Takes a CMS Data-Type message and extracts the encapsulated data. More... | |
| int | C_ReadSignedDataMsg (CERTC_CTX ctx, CERT_PATH_CTX *pathCtx, SERVICE database, ITEM *signedDataMsg, UINT4 cmsOptions, ITEM *data, ITEM *oid, LIST_OBJ certificates, LIST_OBJ crls, LIST_OBJ verifiedSigners, LIST_OBJ unverifiedSigners) |
| Checks a CMS Signed-Data message's signature, then extracts the encapsulated data, oid, certificates, crls, verifiedSigners, and unverifiedSigners information. More... | |
| int | C_ReadEnvelopedDataMsg (CERTC_CTX ctx, SERVICE database, ITEM *envelopedDataMsg, ITEM *data, ITEM *oid, RECIPIENT_INFO *recipientInfo, ALGORITHM_IDENTIFIER *contentEncryptionAlgorithmId, B_KEY_OBJ contentEncryptionKey, POINTER reserved1, ATTRIBUTES_OBJ reserved2) |
| Decrypts a CMS Enveloped-Data message, and extracts the encapsulated data, recipientInfo, contentEncryptionAlgorithmId, and contentEncryptionKey. More... | |
| int | C_ReadDigestedDataMsg (CERTC_CTX ctx, ITEM *digestedDataMsg, ITEM *data, ITEM *oid) |
| Decomposes a CMS Digested-Data message, and extracts the encapsulated data and oid. More... | |
| int | C_ReadEncryptedDataMsg (CERTC_CTX ctx, ITEM *encryptedDataMsg, B_KEY_OBJ decryptionKey, ITEM *data, ITEM *oid, ATTRIBUTES_OBJ reserved) |
| Decomposes a CMS Encrypted-Data message, and extracts the encapsulated data and oid. More... | |
| int | C_AddSignerToList (LIST_OBJ listObject, SIGNER_INFO *signer, unsigned int *entryIndex) |
| Adds a copy of a signer to the specified list object. More... | |
| int | C_InsertSignerInList (LIST_OBJ listObject, SIGNER_INFO *signer, unsigned int entryIndex) |
| Inserts a copy of a signer into the specified list object at the given position. More... | |
| int | C_AddUniqueSignerToList (LIST_OBJ listObject, SIGNER_INFO *signer, unsigned int *entryIndex) |
| Adds a copy of a signer to the specified list object if it is not in the list. More... | |
| void | C_FreeSignerEntry (SIGNER_INFO **value) |
Destroys a SIGNER_INFO data structure and its members, and sets the pointer to NULL_PTR. More... | |
| void | C_FreeSignerInfo (SIGNER_INFO *value) |
Destroys a SIGNER_INFO data structure's members and frees the associated memory. More... | |
| int | C_AddRecipientToList (LIST_OBJ listObject, RECIPIENT_INFO *recipient, unsigned int *entryIndex) |
| Adds a copy of a recipient to the specified list object. More... | |
| int | C_InsertRecipientInList (LIST_OBJ listObject, RECIPIENT_INFO *recipient, unsigned int entryIndex) |
| Inserts a copy of a recipient into the specified list object at the given position. More... | |
| int | C_AddUniqueRecipientToList (LIST_OBJ listObject, RECIPIENT_INFO *recipient, unsigned int *entryIndex) |
| Adds a copy of a recipient to the specified list object if it is not in the list. More... | |
| void | C_FreeRecipientEntry (RECIPIENT_INFO **value) |
Destroys a RECIPIENT_INFO data structure and its members, and sets the pointer to NULL_PTR. More... | |
| void | C_FreeRecipientInfo (RECIPIENT_INFO *value) |
Destroys a RECIPIENT_INFO data structure's members and frees the associated memory. More... | |
|
||||||||||||||||
|
Adds a copy of a recipient to the specified list object. Duplicate list entries are permitted.
|
|
||||||||||||||||
|
Adds a copy of a signer to the specified list object. Duplicate list entries are permitted.
|
|
||||||||||||||||
|
Adds a copy of a recipient to the specified list object if it is not in the list. This function does not add the recipient if it is on the list already. Duplicate list entries (which are determined by matching issuer names and serial numbers) are not permitted.
|
|
||||||||||||||||
|
Adds a copy of a signer to the specified list object if it is not in the list. It does not add the signer if the signer is on the list already. Duplicate list entries (which are determined by matching issuer names and serial numbers) are not permitted.
|
|
|
Destroys a
|
|
|
Destroys a
|
|
|
Destroys a
|
|
|
Destroys a
|
|
||||||||||||||||
|
Inserts a copy of a recipient into the specified list object at the given position. Duplicate list entries are permitted.
|
|
||||||||||||||||
|
Inserts a copy of a signer into the specified list object at the given position. Duplicate list entries are permitted.
|
|
||||||||||||||||
|
Takes a CMS Data-Type message and extracts the encapsulated data.
|
|
||||||||||||||||||||
|
Decomposes a CMS Digested-Data message, and extracts the encapsulated data and oid.
|
|
||||||||||||||||||||||||||||
|
Decomposes a CMS Encrypted-Data message, and extracts the encapsulated data and oid. Note that the encryption key and algorithm identifier are not included in the message. This information must be exchanged with the sender by other means.
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Decrypts a CMS Enveloped-Data message, and extracts the encapsulated data, recipientInfo, contentEncryptionAlgorithmId, and contentEncryptionKey. The caller is responsible for allocating and freeing all memory used by the recipientInfo, contentEncryptionAlgorithmId, and contentEncryptionKey return variables. Cert-C first searches the service specified by the database parameter for the recipient certificate used to encrypt the internal content-encryption key. This recipient certificate is then used to look up the private key needed to decrypt the internal content-encryption key. If the information is not found in database, Cert-C checks for the necessary information in the database referenced in the ctx context.
|
|
||||||||||||||||
|
Extracts the OID from a CMS-formatted message. This allows the application to determine the message type so the correct
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Checks a CMS Signed-Data message's signature, then extracts the encapsulated data, oid, certificates, crls, verifiedSigners, and unverifiedSigners information. The caller is responsible for freeing the memory associated with data, certificates, crls, verifiedSigners, and unverifiedSigners. Cert-C first searches the service specified by the database parameter for the signer certificates, which enable certificate-path verification, and for associated CRLs, which provide relevant revocation status. If the information is not found in database, Cert-C checks for the necessary information in the database referenced in the certificates object and then in the ctx context. The function can put the signer in either the verifiedSigners or the unverifiedSigners LIST_OBJ. The following table shows the placement of the signer in different scenarios. The return value alone cannot be used to determine the location of the signer.
|
|
||||||||||||||||
|
Prepares a simple data message. The output of this function is a correctly formatted CMS Data-Type message, which contains the
|
|
||||||||||||||||||||
|
Prepares a digested data message. The output of this function is a properly formatted CMS Digested Data message.
|
|
||||||||||||||||||||||||||||
|
Prepares an encrypted data message. The output of this function is a correctly formatted CMS Encrypted-Data message. The encryption key and algorithm identifier are not included in the message; the key and algorithm must be exchanged with the recipient by other means.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Prepares an enveloped-data message. The output is a correctly formatted CMS Enveloped-Data message. If both contentEncryptionAlgorithmId and encryptionKey are
If encryptionKey is Cert-C first searches the service specified by database parameter for the recipient certificate used to encrypt the internal content-encryption key. If the information is not found in database, Cert-C checks for the necessary information in the database referenced in the ctx context.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Prepares a signed-data message. The output of this function is a correctly formatted CMS Signed-Data message. The data content to be signed must be a BER-encoded PKCS #7 message.
|