.pem openssl 中证书的十六进制详细信息

发布于 2024-08-26 00:55:55 字数 145 浏览 4 评论 0原文

我已经使用 openssl mycert.pem 生成了其中包含的证书。我将 Base64 文本转换为十六进制。

我想知道是否可以从 c 中的十六进制字符串中提取信息(不使用 openssl 库)。例如公钥、发行者、主体、有效性信息等。

谢谢。

I have generated using openssl mycert.pem which contents the certificate. And I converted the base64 text into hex.

I wonder if it's possible to extract the informations from the hex string in c (without using the openssl library). For example, the public key, the issuer, the subject, the validity information, etc.

Thanks.

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

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

发布评论

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

评论(2

人生戏 2024-09-02 00:55:55

可以,但是非常麻烦。除了 Base64 取消编码之外,您还必须实现 ASN1 解析器。

您可能会找到一些快捷方式,无需使用完整的 ASN1 解析器即可提取证书的某些部分。

ASN1 协议格式包含结构化数据,其中可以跳过某些部分而无需完全解码,因为每个条目的每个标头都包含一个大小字段,因此您可能会跳过您不感兴趣的证书部分。

Yes but it is very cumbersome. You have to implement an ASN1 parser apart from the Base64 unencoding.

You might find shortcuts where you can extract certain parts of the certificate without using a full ASN1 parser.

The ASN1 protocol format contains structured data where parts can be skipped without being fully decoded since each header of each entry containins a size field, so you might for example skip parts of a certificate that is not of your interest.

安静 2024-09-02 00:55:55

当然可以解析。然而 X509 并不是最容易解析的格式。 这里是对 RFC 的参考,应该会对您有所帮助。

Of course you can parse. However X509 is not the easiest format to parse. Here is a reference to the RFC that should help you.

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