Skip to content

parseKey for ECDSA doesn't retrieve parameters #82

@Rus1an31

Description

@Rus1an31

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?

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