public class LunaKeyPairDerivationBIP32Child extends KeyPairGeneratorSpi
KeyPair.| Modifier and Type | Field and Description |
|---|---|
protected LunaKey |
baseKey
Base key from which to derive a KeyPair.
|
protected static Logger |
LOGGER |
protected LunaNamedCurve |
mCurve
Bip32 curve is "secp256k1"
|
protected long |
mechType
Specifies either master or child KeyPair to be derived.
|
protected int[] |
path
An integer array containing the key derivation path elements.
|
| Constructor and Description |
|---|
LunaKeyPairDerivationBIP32Child() |
| Modifier and Type | Method and Description |
|---|---|
protected int[] |
convertPath(String pathStr)
Convert the BIP32 key path to an integer array for passing to the HSM.
|
KeyPair |
generateKeyPair()
Derive the KeyPair.
|
void |
initialize(AlgorithmParameterSpec params,
SecureRandom random)
Initialize the BIP32 key derivation operation based on the supplied LunaBIP32ParameterSpec.
|
void |
initialize(int i,
SecureRandom secureRandom)
Not implemented.
|
protected static final Logger LOGGER
protected LunaNamedCurve mCurve
protected long mechType
protected LunaKey baseKey
protected int[] path
protected int[] convertPath(String pathStr)
Note: The path MUST be specified using the notation in the BIP44 specification: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#path-levels
Example: "m/12'/34'/56/78"
Observe:
Path elements ending with an apostrophe "'" will be created as hardened keys. A leading "m" is decorative only.
pathStr - the string representation of the pathpublic void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
initialize in class KeyPairGeneratorSpiparams - an instance of a LunaBIP32ParameterSpecrandom - unusedInvalidAlgorithmParameterException - If the parameterspec is not a LunaBIP32ParameterSpecInvalidParameterException - If base key is unspecifiedpublic void initialize(int i,
SecureRandom secureRandom)
initialize in class KeyPairGeneratorSpipublic KeyPair generateKeyPair()
generateKeyPair in class KeyPairGeneratorSpiKeyPair object containing the public and private keys.Copyright 2014-2018 SafeNet. All rights reserved.