Download Security Toolkit
Transcript
210 Certificates in Detail Component Description The type is an ISO object identifier and the corresponding value is a binary string that can contain anything, identified by the object identifier (if you know what this is then you should also know how to obtain one). RegisteredID An object identifier (again, if you know what this is then you should know how to obtain one). You can specify this value with CRYPT_CERTINFO_REGISTEREDID. RFC822Name An email address. You can specify this value with CRYPT_CERTINFO_RFC822NAME. For compatibility with the older (obsolete) PKCS #9 emailAddress attribute, cryptlib will also accept CRYPT_CERTINFO_EMAIL to specify this field. UniformResourceIdentifier A URL for either FTP, HTTP, or LDAP access as per RFC 1738. You can specify this value with CRYPT_CERTINFO_UNIFORMRESOURCEIDENTIFIER. Of the above GeneralName components, the most useful ones are the RFC822Name (to specify an email address), the DNSName (to specify a server address), and the UniformResourceIdentifier (to specify a web page or FTP server). Somewhat less us e f uli st heDi r e c t or y Na me , whi c hc a ns p e c i f ya dd i t i o na li nf or ma t i ont ha tdo e s n ’ tf i t easily into the main certificate DN. The other components should be avoided unless y ouha v eag oodr e a s ont or e q ui r et h e m( t ha ti s , do n’ tus et h e mj us tb e c a us et h e y ’ r e there). Working with GeneralName Components Now that the details of GeneralNames have been covered, you can use them to add additional identification information to certificate requests and certificates. For example to add an email address and home page URL to the certification request shown earlier you would use: CRYPT_CERTIFICATE cryptCertRequest; /* Create certification request and add other components */ /* ... */ /* Add identification information */ /* ... */ /* Add additional identification information */ cryptSetAttributeString( cryptCertRequest, CRYPT_CERTINFO_RFC822NAME, "[email protected]", 12 ); cryptSetAttributeString( cryptCertRequest, CRYPT_CERTINFO_UNIFORMRESOURCEIDENTIFIER, "http://www.cci.com/~paul", 23 ); /* Sign certification request and transmit to CA */ /* ... */ Although GeneralNames are commonly used to identify a certificates owner just like a DN, they are in fact a certificate extension rather than a basic attribute. Each certificate can contain multiple extensions that contain GeneralNames. The various e x t e ns i onst ha tc a nc on t a i nGe ne r a l Na me sa r ec ov e r e di n“ Certificate Extensions”on page 224, a n dt hede t a i l sofwor k i ngwi t ht h e ma r ee x pl a i ne di n“ Composite Extension Attributes”o npa g e227. Certificate Fingerprints Ce r t i f i c a t e sa r es o me t i me si d e nt i f i e dt hr o ug h“ f i ng e r pr i nt s ”t ha tc o ns t i t u t ee i t he ra n MD5 or SHA-1 hash of the certificate data (the most common form is an MD5 hash). Youc a nob t a i nac e r t i f i c a t e ’ sf i ng e r pr i ntbyr e a di ngi t sCRYPT_CERTI NFO_-