公钥的格式是什么?

发布于 2024-11-17 10:06:45 字数 37 浏览 9 评论 0原文

DSA 公钥的格式是什么?所有证书都存储在base64中吗?

What is the format of public DSA key? And are all certificates are stored in base64?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失退 2024-11-24 10:06:45

您的意思是证书中使用的公钥格式吗?

通常,证书中的公钥存储在SubjectPublicKeyInfo字段中(参见RFC 5280)

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

DSA的具体信息可以在RFC 3370。通常,AlgorithmIdentifier 的参数包含 Dss-Parms 的实例,为您提供 p、k、g,而 subjectPublicKey BIT STRING 包含编码为 DER 编码的 INTEGER 的公钥 y。

关于 Base64:严格来说,证书不是 Base64 编码的,而是使用它的扩展形式,即 PEM 格式,这是一种纯文本格式,是包含在之间的 X.509 证书 (RFC5280) 的 Base64 编码行

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

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

证书本身是 ASN.1 结构的 DER 编码,如 RFC 5280 中所述。请参阅 X.690 了解 DER 的详细信息(杰出编码规则)。

大多数证书以 PEM 格式存储或直接以其原始 DER 编码形式存储。

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.

北斗星光 2024-11-24 10:06:45

此页面上有大量有关规格的信息和参考。
http://en.wikipedia.org/wiki/Digital_Signature_Algorithm

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文