证书的OpenSSL打印OID

发布于 2025-02-05 03:18:12 字数 393 浏览 2 评论 0原文

我正在面对一个问题,我正在尝试查看证书的EKU的OID。 但是运行时

openssl x509 -in证书.crt -text -noout

我得到

x509v3扩展密钥用法:
TLS Web客户端身份验证,Microsoft SmartCard登录

而不是

1.3.6.1.4.1.311.20.2.2

您知道将其打印到屏幕上的一种方法,我已经看到了另一个帖子,但是使用代码,我只想使用命令行。

我尝试了所有可能有用的 -certopt ,但我没有得到结果。

I'm confronting an issue, I'm trying to see the OIDs of the EKU of a certificate.
But when running

openssl x509 -in certificate.crt -text -noout

I get

X509v3 Extended Key Usage:
TLS Web Client Authentication, Microsoft Smartcard Login

instead of

1.3.6.1.4.1.311.20.2.2

Do you know a way of printing it to the screen, I've seen another post but using code and I want it using command line only.

I've tried all the -certopt that might be useful, but I didn't get the result wanted.

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

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

发布评论

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

评论(1

温柔嚣张 2025-02-12 03:18:12

一段时间后,我发现它是用别名替换OID的OpenSL,

因此您只需要手动解码证书即可。

为此,您可以使用任何ASN.1解析器或X509解码器,
我建议cyberchef gchq.github.io/cyberchef

例如,如果我使用基本的openssl工具:

X509v3 extensions:
            .....

            X509v3 Extended Key Usage: 
                TLS Web Client Authentication, Microsoft Smartcard Login
            .....

并且使用cyberchef rfc x509 parser:

Extensions
         .....

         extKeyUsage :
            clientAuth, 1.3.6.1.4.1.311.20.2.2

         .....

如果您想要更多的详细信息,则可以使用RFC ASN.1 Parser.1 Parser.1 Parser 。

SEQUENCE
          ObjectIdentifier extKeyUsage (2 5 29 37)
          OCTETSTRING, encapsulates
            SEQUENCE
              ObjectIdentifier clientAuth (1 3 6 1 5 5 7 3 2)
              ObjectIdentifier (1 3 6 1 4 1 311 20 2 2)

After sometime away from the subject, I found that it was OpenSSL that replaces OIDs with aliases

So you just have to decode the certificate manually.

To do that, you can use any ASN.1 parser or x509 decoder,
I recommend CyberChef gchq.github.io/CyberChef

for example if I use the basic OpenSSL tool :

X509v3 extensions:
            .....

            X509v3 Extended Key Usage: 
                TLS Web Client Authentication, Microsoft Smartcard Login
            .....

And with CyberChef rfc x509 parser :

Extensions
         .....

         extKeyUsage :
            clientAuth, 1.3.6.1.4.1.311.20.2.2

         .....

and if you want more detail, you can use the rfc ASN.1 parser.

SEQUENCE
          ObjectIdentifier extKeyUsage (2 5 29 37)
          OCTETSTRING, encapsulates
            SEQUENCE
              ObjectIdentifier clientAuth (1 3 6 1 5 5 7 3 2)
              ObjectIdentifier (1 3 6 1 4 1 311 20 2 2)

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