Skip to content

Can't parse PEM certificate #14

Description

@alecapu80

Hi
I've a issue with a PEM certificate:

My code:
const fs = require('fs');
const { Certificate, PrivateKey } = require('@fidm/x509');
const ed25519Cert = Certificate.fromPEM(fs.readFileSync('../data/device_cert.pem'));

Exception:
/test/node_modules/@fidm/asn1/build/asn1.js:751
throw err;
^

Error: ASN.1 object validate failure for authorityKeyIdentifier.value: error tag BOOLEAN
at ASN1.validate (/test/node_modules/@fidm/asn1/build/asn1.js:934:20)
at ASN1.validate (/test/node_modules/@fidm/asn1/build/asn1.js:943:43)
at Function.parseDERWithTemplate (/test/node_modules/@fidm/asn1/build/asn1.js:748:25)
at decodeExtAuthorityKeyIdentifier (/test/node_modules/@fidm/x509/build/x509.js:652:34)
at certificateExtensionFromAsn1 (/test/node_modules/@fidm/x509/build/x509.js:502:13)
at certificateExtensionsFromAsn1 (/test/node_modules/@fidm/x509/build/x509.js:456:22)
at new Certificate (/test/node_modules/@fidm/x509/build/x509.js:310:31)
at Function.fromPEMs (/test/node_modules/@fidm/x509/build/x509.js:252:24)
at Function.fromPEM (/test/node_modules/@fidm/x509/build/x509.js:264:28)
at Object. (/test/test.js:5:33)

My certificate is a standard certificate generated with openssl and other tools are able to parse and open.

Can you support me?

Alessandro

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions