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. |
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 . |
Returns:
The digest value.
- Type
- Blob
getKeyDer() → {Blob}
Get the raw bytes of the public key in DER format.
Returns:
The public key DER.
- Type
- Blob
getKeyType() → {number}
Get the key type.
Returns:
The key type as an int from KeyType.
- Type
- number
toDer() → {DerNode}
Encode the public key into DER.
Returns:
The encoded DER syntax tree.
- Type
- DerNode