Skip to content
New issue

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

parseKey for ECDSA doesn't retrieve parameters #82

Open
Rus1an31 opened this issue Mar 4, 2022 · 0 comments
Open

parseKey for ECDSA doesn't retrieve parameters #82

Rus1an31 opened this issue Mar 4, 2022 · 0 comments

Comments

@Rus1an31
Copy link

Rus1an31 commented Mar 4, 2022

I'm trying to parse public key with sshpk.parseKey(publicKeyString, 'pem') which has been created with algorithm: "ECDSA" and ecdsaCurve: "P256".
Key is of type:
-----BEGIN PUBLIC KEY-----
Blah-blah-blah
-----END PUBLIC KEY-----

var key = sshpk.parseKey(publicKeyString, 'pem');
console.log('Type = ' + key.type);
console.log('Alg = ' + key.alg);
console.log('Kty = ' + key.kty);
console.log('Kid = ' + key.kid);
console.log('Crv = ' + key.crv);
console.log('Use = ' + key.use);
console.log('X = ' + key.x);
console.log('Y = ' + key.y);

When I'm trying to call sshpk.parseKey(publicKeyString, 'pem') and pass public key in publicKeyString it's working without error. But above code returns:

Type = ecdsa
Alg = undefined
Kty = undefined
Kid = undefined
Crv = undefined
Use = undefined
X = undefined
Y = undefined

So values X, Y and others are not initialized. Why all parameters are not initialized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant