Skip to content

Unexpected two dots for custom x509 extension #24418

Answered by botovq
e-cloud asked this question in Q&A
Discussion options

You must be logged in to vote

This is expected. The two dots are just part of a hexdump of the extension's value, which you configured to be a UTF8String. From openssl asn1parse -i -in certificate.pem:

  605:d=4  hl=2 l=  21 cons:     SEQUENCE
  607:d=5  hl=2 l=   4 prim:      OBJECT            :1.2.3.4.5
  613:d=5  hl=2 l=  13 prim:      OCTET STRING      [HEX DUMP]:0C0B68656C6C6F20776F726C64

The first dot is 0C, the ASN.1 tag for UTF8String, and the second dot is 0B, the length. The remaining octets encode hello world in ASCII.

Less clunky tools such as der-ascii show

        SEQUENCE {
          OBJECT_IDENTIFIER { 1.2.3.4.5 }
          OCTET_STRING {
            UTF8String { "hello world" }
          }
        }

w…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by t8m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #24415 on May 16, 2024 08:34.