Signature Sample
This section steps through the signature process. This sample starts with the hash value used in the previous sample; that is, an MD5 hash of the "1134-kelp" string. This hash value is shown below: 0x00000000 73 40 e6 e2 74 b8 ea 39 s@..t..9 0x00000008 93 95 aa 29 d6 38 b5 2a ...).8.* This example assumes that the application specified "Test Signature" as the description string. The first thing that the CSP does is to add this string to the hash object that is being signed. Of course, the description string is received by the CSP in Unicode format, as shown below: 0x00000000 54 00 65 00 73 00 74 00 T.e.s.t. 0x00000008 20 00 53 00 69 00 67 00 .S.i.g. 0x00000010 6e 00 61 00 74 00 75 00 n.a.t.u. 0x00000018 72 00 65 00 r.e. Once the description string has been hashed in, the hash value is extracted: 0x00000000 a8 2b df c2 c9 f1 bb 62 .+.....b 0x00000008 38 78 d4 60 fa ce 5c 2a 8x.`..\* The next step is building a PKCS signature block. This is always the same size as the public key's modulus (64 bytes) and contains the following fields:Bytes
| Description
|
16
| Hash of data to be signed. The size of this field will vary, depending on the
hash algorithm used.
As you can see from comparing the hex dump of the hash value above and the hex dump of the following encryption block, the bytes in the hash value are reversed before they are placed in the encryption block. This is because Windows NT formats data in little endian format, and the encryption block must be built in big endian format. |
18
| ASN.1 encoded hash algorithm specifier. The size of this field will vary,
depending on the hash algorithm used. Note that this data is also reversed.
A description of ASN.1 is beyond the scope of this document, but a table of common ASN.1 strings is provided in the next section. For more information on ASN.1, see the PKCS documentation. |
Zero value.
| |
27
| Padding data (0xff's). The size of this field is adjusted as necessary so that
the signature block's overall length is correct.
|
The PKCS block type (0x01).
| |
Zero value.
|
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers - More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples - Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database