Class: PublicKey

PublicKey

new PublicKey(keyDer)

Create a new PublicKey by decoding the keyDer. Set the key type from the decoding.
Parameters:
Name Type Description
keyDer Blob The blob of the SubjectPublicKeyInfo DER.
Source:
Throws:
UnrecognizedKeyFormatException if can't decode the key DER.

Methods

getDigest(digestAlgorithm) → {Blob}

Get the digest of the public key.
Parameters:
Name Type Description
digestAlgorithm number (optional) The integer from DigestAlgorithm, such as DigestAlgorithm.SHA256. If omitted, use DigestAlgorithm.SHA256 .
Source:
Returns:
The digest value.
Type
Blob

getKeyDer() → {Blob}

Get the raw bytes of the public key in DER format.
Source:
Returns:
The public key DER.
Type
Blob

getKeyType() → {number}

Get the key type.
Source:
Returns:
The key type as an int from KeyType.
Type
number

toDer() → {DerNode}

Encode the public key into DER.
Source:
Returns:
The encoded DER syntax tree.
Type
DerNode