We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm working on p12 generation for ECC keytype pem and certs.
I'm getting error when I'm passing EC private key to below logic, can you guide me if you have any idea?
const { PEM, ASN1, Class, Tag } = require('@fidm/asn1') // ASN.1 Template https://tools.ietf.org/html/rfc5208 const privateKeyValidator = { name: 'PrivateKeyInfo', class: Class.UNIVERSAL, tag: Tag.SEQUENCE, capture: 'privateKeyInfo', value: [{ name: 'PrivateKeyInfo.Version', class: Class.UNIVERSAL, tag: Tag.INTEGER, capture: 'privateKeyVersion' }, { name: 'PrivateKeyInfo.AlgorithmIdentifier', class: Class.UNIVERSAL, tag: Tag.SEQUENCE, value: [{ name: 'PrivateKeyAlgorithmIdentifier.algorithm', class: Class.UNIVERSAL, tag: Tag.OID, capture: 'privateKeyOID' }] }, { name: 'PrivateKeyInfo.PrivateKey', class: Class.UNIVERSAL, tag: Tag.OCTETSTRING, capture: 'privateKey' }] } const rootkey = PEM.parse(fs.readFileSync('ecctestPK.pem'))[0]; console.log(rootkey) const captures = ASN1.parseDERWithTemplate(rootkey.body, privateKeyValidator); console.log("******************") console.log(captures)```
The text was updated successfully, but these errors were encountered:
EC 256Primev1 Private key
-----BEGIN EC PRIVATE KEY----- MHcCAQEEIHlY0FBpEKL+EVEdkDk9x0OxTEO8HJrPxH2ALoB5+xDIoAoGCCqGSM49 AwEHoUQDQgAE6dDBAXOEbl0bq+kR3JAex4SKz8gVcMCopLdxaeYFdAPOMTdifQuB 1+lSQ6Lyl3Vq8zFrKwW6hU9RQ5gS1tjb6w== -----END EC PRIVATE KEY-----
Sorry, something went wrong.
No branches or pull requests
Hi, I'm working on p12 generation for ECC keytype pem and certs.
I'm getting error when I'm passing EC private key to below logic, can you guide me if you have any idea?
The text was updated successfully, but these errors were encountered: