@JvmStatic fun deriveKeyPair(signatureScheme: SignatureScheme, privateKey: PrivateKey, seed: ByteArray): KeyPair
Deterministically generate/derive a KeyPair using an existing private key and a seed as inputs. This operation is currently supported for ECDSA secp256r1 (NIST P-256), ECDSA secp256k1 and EdDSA ed25519.
Similarly to BIP32, the implemented algorithm uses an HMAC function based on SHA512 and it is actually an implementation the HKDF rfc - Step 1: Extract function,
signatureScheme
- the SignatureScheme of the private key input.
privateKey
- the PrivateKey that will be used as key to the HMAC-ed DKG function.
seed
- an extra seed that will be used as value to the underlying HMAC.
IllegalArgumentException
- if the requested signature scheme is not supported.
UnsupportedOperationException
- if deterministic key generation is not supported for this particular scheme.
Return
a new deterministically generated KeyPair.
@JvmStatic fun deriveKeyPair(privateKey: PrivateKey, seed: ByteArray): KeyPair
Deterministically generate/derive a KeyPair using an existing private key and a seed as inputs. Use this method if the SignatureScheme of the private key input is not known.
privateKey
- the PrivateKey that will be used as key to the HMAC-ed DKG function.
seed
- an extra seed that will be used as value to the underlying HMAC.
IllegalArgumentException
- if the requested signature scheme is not supported.
UnsupportedOperationException
- if deterministic key generation is not supported for this particular scheme.
Return
a new deterministically generated KeyPair.