Index   Commented   Search   About

Private Key Blob Format

Private key blobs (type PRIVATEKEYBLOB) are used to store RSA public/private key pairs. They have the following format:

BLOBHEADER blobheader;

RSAPUBKEY rsapubkey;

BYTE modulus[rsapubkey.bitlen/8];

BYTE prime1[rsapubkey.bitlen/16];

BYTE prime2[rsapubkey.bitlen/16];

BYTE exponent1[rsapubkey.bitlen/16];

BYTE exponent2[rsapubkey.bitlen/16];

BYTE coefficient[rsapubkey.bitlen/16];

BYTE privateExponent[rsapubkey.bitlen/8];

If the key blob is encrypted, then everything but the BLOBHEADER portion of the blob is encrypted. Note that the encryption algorithm and encryption key parameters are not stored along with the private key blob. It is the responsibility of the application to manage this information.

The following table describes each private key blob component. Note that these fields largely correspond to the ones described in section 7.2 of PKCS #1: RSA Encryption Standard.

Field
Description
blobheader
A BLOBHEADER structure as described in a previous section. The bType field must always have a value of PRIVATEKEYBLOB.
rsapubkey
A RSAPUBKEY structure as described in a previous section. The magic field must always have a value of 0x32415352 ("RSA2").
modulus
The modulus. This has a value of "prime1 * prime2" and is often known as "n".
prime1
Prime number 1, often known as "p".
prime2
Prime number 2, often known as "q".
exponent1
Exponent 1. This has a numeric value of "d mod (p - 1)".
exponent2
Exponent 2. This has a numeric value of "d mod (q - 1)".
coefficient
Coefficient. This has a numeric value of "(inverse of q) mod p".
privateExponent
Private exponent, often known as "d".

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun