RSA Security logo

RSA BSAFE Cert-C
API Reference

ALGORITHM_IDENTIFIER Struct Reference

Uniquely identifies an algorithm.

This structure is used in the KEY_TRANSPORT_INFO, PBM_INFO, PKI_KEY_TRANSPORT_INFO, PKI_RECIPIENT, PKI_RECIPIENT_INFO, PKI_SENDER_INFO, and SIGNER_INFO structures. It is also used with the C_WriteEnvelopedDataMsg(), C_ReadEnvelopedDataMsg(), and C_WriteEncryptedDataMsg() functions.

Data Fields
algorithmId An int value that represents an algorithm identifier. Cert-C supports message-digest algorithms, content- encryption algorithms, a key-encryption algorithm, and signature algorithms, as listed in the following tables. (Each individual function description lists the algorithms that can be used with that particular function.)
  • Identifiers for the message-digest algorithms:

    Algorithm Identifier Description
    DAI_SHA1 SHA-1 message digest algorithm (20-byte digest)
    DAI_MD5 MD5 message digest algorithm (16-byte digest)
    DAI_PBM Password-based MAC message digest algorithm
    DAI_MD2 MD2 message digest algorithm (16-byte digest)


  • Identifiers for the content-encryption algorithms:

    Algorithm Identifier Description
    EAI_DES DES algorithm in CBC mode
    EAI_DES3 Triple DES algorithm in CBC mode
    EAI_RC2 RC2 (r) algorithm in CBC mode
    EAI_RC4 RC4 (r) Algorithm in CBC mode
    EAI_RC5 RC5 (r) Algorithm in CBC mode


  • Identifier for the key-encryption algorithm:

    Algorithm Identifier Description
    KA_RSA_ENCRYPTION RSA public-key cryptosystem


  • Identifiers for the signature algorithms:

    Algorithm Identifier Description
    SA_UNDEFINED The signatureAlgorithm is explicitly not set, unknown, or unnecessary.
    SA_MD2_WITH_RSA_ENCRYPTION MD2 digest algorithm and the RSA public-key algorithm
    SA_MD5_WITH_RSA_ENCRYPTION MD5 digest algorithm and the RSA public-key algorithm
    SA_SHA1_WITH_RSA_ENCRYPTION SHA-1 digest algorithm and the RSA public-key algorithm
    SA_OIW_SHA1_WITH_RSA_ENCRYPTION SHA-1 digest algorithm, the OAEP masking according to OIW (OSI Implementers' Workshop) syntax, and the RSA public-key algorithm
    SA_DSA_WITH_SHA1 SHA-1 digest algorithm and the Digital Signature Algorithm
    SA_RSA_ENCRYPTION RSA public-key cryptosystem. (This algorithm is not for general use. It should be used only in cases where the associated digestAlgorithm can be inferred from elsewhere.)
algorithmParam A pointer to a Crypto-C algorithm object that contains algorithm parameters. This member is optional for all algorithm types. The algorithm object differs, depending on the chosen algorithm, as follows:
  • For RC2 and RC5, algorithmParam is optional.
    • If you do not set any values for algorithmParam, Cert-C sets the effective key- bits value to 40 in the corresponding encryption parameters structure (A_RC2_CBC_PARAMS for RC2 and A_RC5_CBC_PARAMS for RC5). Cert-C also sets the initialization vector (IV) to an 8-byte field initialized with randomly generated data.
    • If you set only the effective key-bits value, Cert-C generates a random 8-byte IV.

  • For DES and Triple DES, algorithmParam is optional.
    • If you do not set any values for algorithmParam, Cert-C sets the encryption parameters to NULL_PTR, and sets the IV to an 8-byte field initialized with randomly generated data.
    • If you pass in an IV, then it must point to an unsigned char array that holds the 8 bytes of the initialization vector.

  • For all other algorithms, set algorithmParam to NULL_PTR.

#include <certalg.h>

00188 typedef struct {
00189   int     algorithmId;
00190   POINTER algorithmParam;
00191 } ALGORITHM_IDENTIFIER;

The documentation for this struct was generated from the following file:


RSA BSAFE® Cert-C 2.7 API Reference