How can I get the CommonName of a certificate? #468
Replies: 1 comment
-
|
Hi, have you checked the type Basically, the subject contains oid-value pairs, where The value of matching attribute OID is encoded according to type definition. -- Naming attributes of type X520CommonName
id-at-commonName AttributeType ::= { id-at 3 }
-- Naming attributes of type X520CommonName:
-- X520CommonName ::= DirectoryName (SIZE (1..ub-common-name))
--
-- Expanded to avoid parameterized type:
X520CommonName ::= CHOICE {
teletexString TeletexString (SIZE (1..ub-common-name)),
printableString PrintableString (SIZE (1..ub-common-name)),
universalString UniversalString (SIZE (1..ub-common-name)),
utf8String UTF8String (SIZE (1..ub-common-name)),
bmpString BMPString (SIZE (1..ub-common-name)) }
( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Thanks for making this crate.
I successfully decoded a rasn_pkix::Certificate, and I can debug-print the tbs_certificate.subject, and I can see that there is a CN because there is an entry with OID 2.5.4.3. I can also see that there is a CommonName struct in the crate. But I don't see how I'm supposed to get at the information inside of Subject.
How can I get an instance of the CommonName struct from a certificate subject if present?
Or more generally, how can I get instances of the appropriate types for the things inside of subject?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions