BCRYPT_RSAKEY_BLOB Structure

The BCRYPT_RSAKEY_BLOB structure is used as a header for an RSA public key or private keyBLOB in memory.

Syntax

typedef struct _BCRYPT_RSAKEY_BLOB {
    ULONG Magic;
    ULONG BitLength;
    ULONG cbPublicExp;
    ULONG cbModulus;
    ULONG cbPrime1;
    ULONG cbPrime2;
} BCRYPT_RSAKEY_BLOB;  

Members

Magic
Specifies the type of RSA key this BLOB represents. This can be one of the following values.

BitLength
The size, in bits, of the key.

cbPublicExp
The size, in bytes, of the exponent of the key.

cbModulus
The size, in bytes, of the modulus of the key.

cbPrime1
The size, in bytes, of the first prime number of the key. This is only used for private key BLOBs.

cbPrime2
The size, in bytes, of the second prime number of the key. This is only used for private key BLOBs.

Remarks

This structure is used as a header for a larger buffer. An RSA public key BLOB (BCRYPT_RSAPUBLIC_BLOB) has the following format in contiguous memory. All of the numbers following the structure are in big-endian format.

Example

BCRYPT_RSAKEY_BLOB
PublicExponent[cbPublicExp] // Big-endian.
Modulus[cbModulus] // Big-endian.  

An RSA private key BLOB (BCRYPT_RSAPRIVATE_BLOB) has the following format in contiguous memory. All of the numbers following the structure are in big-endian format.

Example

BCRYPT_RSAKEY_BLOB
PublicExponent[cbPublicExp] // Big-endian.
Modulus[cbModulus] // Big-endian.
Prime1[cbPrime1] // Big-endian.
Prime2[cbPrime2] // Big-endian.  

A full RSA private key BLOB (BCRYPT_RSAFULLPRIVATE_BLOB) has the following format in contiguous memory. All of the numbers following the structure are in big-endian format.

Example

BCRYPT_RSAKEY_BLOB
PublicExponent[cbPublicExp] // Big-endian.
Modulus[cbModulus] // Big-endian.
Prime1[cbPrime1] // Big-endian.
Prime2[cbPrime2] // Big-endian.
Exponent1[cbPrime1] // Big-endian.
Exponent2[cbPrime2] // Big-endian.
Coefficient[cbPrime1] // Big-endian.
PrivateExponent[cbModulus] // Big-endian.  

Requirements

Header: Declared in bcrypt.h.

Library: Use bcrypt.lib.