Implementation of legacy EdDSA following RFC4880bis-03 for OpenPGP. This key type has been deprecated by the crypto-refresh RFC.
Methods
(async, static) sign(oid, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{r: Uint8Array, s: Uint8Array}>}
Sign a message using the provided legacy EdDSA key
Parameters:
Name | Type | Description |
---|---|---|
oid |
module:type/oid | Elliptic curve object identifier |
hashAlgo |
module:enums.hash | Hash algorithm used to sign (must be sha256 or stronger) |
message |
Uint8Array | Message to sign |
publicKey |
Uint8Array | Public key |
privateKey |
Uint8Array | Private key used to sign the message |
hashed |
Uint8Array | The hashed message |
Returns:
Signature of the message
- Type
- Promise.<{r: Uint8Array, s: Uint8Array}>
(async, static) validateParams(oid, Q, k) → {Promise.<Boolean>}
Validate legacy EdDSA parameters
Parameters:
Name | Type | Description |
---|---|---|
oid |
module:type/oid | Elliptic curve object identifier |
Q |
Uint8Array | EdDSA public point |
k |
Uint8Array | EdDSA secret seed |
Returns:
Whether params are valid.
- Type
- Promise.<Boolean>
(async, static) verify(oid, hashAlgo, signature, m, publicKey, hashed) → {Boolean}
Verifies if a legacy EdDSA signature is valid for a message
Parameters:
Name | Type | Description |
---|---|---|
oid |
module:type/oid | Elliptic curve object identifier |
hashAlgo |
module:enums.hash | Hash algorithm used in the signature |
signature |
Object | Signature to verify the message |
m |
Uint8Array | Message to verify |
publicKey |
Uint8Array | Public key used to verify the message |
hashed |
Uint8Array | The hashed message |
Returns:
- Type
- Boolean