-
Notifications
You must be signed in to change notification settings - Fork 50
How to get a printable content of a OID #14
Comments
Hey Roberto As far as I remember, PHPASN1 does currently only support DNS names and IP adresses as SAN but I may extend the framework |
Friderich; Thank you for your quick response. I need to search for information contained in the digital certificate '2.16.76.1.3' =>' Required Attributes Certificates' I did it converting the certificate from PEM to DER and using my own "ugly" I send to you the public key in PEM format, if you could help me I would be Roberto 2013/5/4 Friedrich Große [email protected]
Roberto Nisi utile est quod facimus stulta est gloriae (Julius Phaedous) |
Ah so you don't actually want to parse a Subject Alternative Name (SAN) from the certificate extensions but some other arbitrary extensions for which you know the OIDs. The extensions should have the format
I think you may have forgotten to attach the certificate for testing. If you send me the certificate I will look into it today. |
Friderich; yes you are correct and structure is exactly this Sequence { forgive me again for my little knowledge and the certificate is this ... -----BEGIN CERTIFICATE----- |
Hey Roberto, I have created a new example based on the data you provided (see here). I don't (yet) understand the format of the SANs in this certificate. This is what I get when I run the script on my shell:
It seems like all 5 SAN entries are marked as context specific classes but have the same tag value (except the last one which has tag 1). As you can see the octet strings of each of the entries is again encapsulated in a context specific class :/ I think this looks really strange and I'm not yet sure if having the same explicit tag value for the context specific classes is even allowed by the standard. If you have any formal English (or German) document describing this kind of SAN I might give it a second try and include this in the Hope that this helps you Best regards |
Friedrich; Tanks very much !! this will facilitate my work, I hope one day I can repay your kindness. Best regards |
You are welcome Best regards |
I ran across this issue today and wanted to fill in the gap not covered for anyone else hitting the same issue. The structure described is an "otherName" as covered in RFC 5280 section 4.2.1.6. otherNames in the SAN are a sequence of two things, an Object Identifier describing the data type and the value. The octet strings in the tree above are the values. Depending on the data type, they might be further decodable. |
Thx for the comment, based on you hint I will probably implement accessing otherNames directly through the SubjectAlternativeNames class whenever I have the time. |
I need to get a OID content fom Subject alternative name (SAN), OID value: 2.16.76.1.3.3
CNPJ from brasilian certificates.
By the ASN1 class i got only this Octet string :
3081AFA03D0605604C010304A03404323230313031393539303532323535333738383030303030303030303030303030303030303038383734333732787373705350A0210605604C010302A01804164665726E616E646F204A6F7365204B616972616C6C61A0190605604C010303A010040E3538373136353233303030313139A0170605604C010307A00E040C30303030303030303030303081176665726E616E646F4066696D617465632E636F6D2E6272
But is a other way to get this content directly ?
010303A010040E3538373136353233303030313139A0
35 38 37 31 36 35 32 33 30 30 30 31 31 39 => 58716523000119 (this is a CNPJ number)
Tks, for you help
The text was updated successfully, but these errors were encountered: