gbarr / perl-Convert-ASN1

encode/decode data using ASN.1 description
http://search.cpan.org/dist/Convert-ASN1/
13 stars 21 forks source link

decode problem with ASN INTEGER when value is colon seperated hex #18

Open jacksonm opened 10 years ago

jacksonm commented 10 years ago

When encountering a serialNumber (type of CertificateSerialNumber) with type of INTEGER and a value that has a hex encoding format, for example, like 00:00:00:00:00:00:00:00:00:00:00:00, (yes, I know, some CAs seem to have delusions of grandeur with their serial numbering policies) the returned data structure is similar to:

'serialNumber' => bless( { 'value' => [ 237291436, 579135199, 318680686, 480253832, 1492158 ], 'sign' => '+' }, 'Math::BigInt' )

I tried changing the CertificateSerialNumber type to OCTET STRING, but I only got asn decode error. How to proceed with this situation?