RSA Security 5 manual KIPKCSRSAPrivate, Pointer to an Apkcsrsaprivatekey structure

Models: 5

1 376
Download 376 pages 51.16 Kb
Page 286
Image 286

KI_PKCS_RSAPrivate

KI_PKCS_RSAPrivate

Purpose:

This KI allows you to specify a private key of the RSA algorithm as defined in PKCS #1. The information consists of the modulus, exponents, two primes, and the Chinese Remainder Theorem (CRT) information. See KI_PKCS_RSAPrivateBER for the same key info type with BER encoding.

Type of information this allows you to use:

an RSA private key where all the integers are specified as in PKCS #1: modulus, public and private exponents, and Chinese Remainder Theorem information. Note that KI_RSA_CRT can be used for a private key that has the modulus and Chinese Remainder Theorem information but no public or private exponent.

Format of info supplied to B_SetKeyInfo:

pointer to an A_PKCS_RSA_PRIVATE_KEY structure:

typedef struct {

 

ITEM modulus;

/* modulus */

ITEM publicExponent;

/* exponent for public key */

ITEM privateExponent;

/* exponent for private key */

ITEM prime[2];

/* prime factors */

ITEM primeExponent[2];

/* exponents for prime factors */

ITEM coefficient;

/* CRT coefficient */

}A_PKCS_RSA_PRIVATE_KEY;

Each ITEM supplies an integer in canonical format, where the ITEM’s data points to an unsigned byte array, most significant byte first, and the ITEM’s len gives its length. All leading zeros are stripped from each integer before it is copied to the key object.

Format of info returned by B_GetKeyInfo:

pointer to an A_PKCS_RSA_PRIVATE_KEY structure (see above). All leading zeros have been stripped from each integer in the structure.

2 7 6

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 286
Image 286
RSA Security 5 manual KIPKCSRSAPrivate, Pointer to an Apkcsrsaprivatekey structure