开发者

What is the format of public key?

开发者 https://www.devze.com 2023-03-15 18:51 出处:网络
What is the format of public DSA key? And are all certificates 开发者_高级运维are stored in base64?Do you mean the public key format used in a certificate?

What is the format of public DSA key? And are all certificates 开发者_高级运维are stored in base64?


Do you mean the public key format used in a certificate?

Generally, a public key in a certificate is stored in the SubjectPublicKeyInfo field (cf. RFC 5280)

SubjectPublicKeyInfo  ::=  SEQUENCE  {
     algorithm            AlgorithmIdentifier,
     subjectPublicKey     BIT STRING  }

The specifics for DSA can be found in RFC 3370. Usually the parameters of the AlgorithmIdentifier contain an instance of the Dss-Parms giving you p, k, g and the subjectPublicKey BIT STRING contains the public key y encoded as an DER-encoded INTEGER.

Concerning Base64: Strictly speaking certificates are not Base64-encoded but use an extended form of it, the PEM format, a plain text format which is the Base64 encoding of a X.509 certificate (RFC5280) enclosed between the lines

"-----BEGIN CERTIFICATE-----" 
...
"-----END CERTIFICATE-----" 

or

"-----BEGIN X509 CERTIFICATE----" 
...
"-----END X509 CERTIFICATE----". 

The certificate itself is the DER encoding of the ASN.1 structure as described in RFC 5280. See X.690 for details of DER (Distinguished Encoding Rules).

Most certificates are stored either in PEM format or directly in their raw DER-encoded form.


There is a great deal of information and references on this page for the specifications. http://en.wikipedia.org/wiki/Digital_Signature_Algorithm

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号