Class AsymmetricLMSPrivateKey
java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricLMSKey
org.bouncycastle.crypto.asymmetric.AsymmetricLMSPrivateKey
- All Implemented Interfaces:
Destroyable, AsymmetricKey, AsymmetricPrivateKey, Key
Leighton-Micali Hash-Based Signatures (LMS) private keys.
-
Field Summary
Fields inherited from class AsymmetricLMSKey
L -
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricLMSPrivateKey(byte[] encoding) Construct a key from an encoding of a PrivateKeyInfo.AsymmetricLMSPrivateKey(int levels, byte[] keyData, byte[] publicData) AsymmetricLMSPrivateKey(PrivateKeyInfo keyInfo) Construct a key from a PrivateKeyInfo. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()booleanReturn true if o is an equivalent key to this.extractKeyShard(int usageCount) byte[]Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.longgetIndex()byte[]byte[]longinthashCode()Return the hashCode for the key.booleanMethods inherited from class AsymmetricLMSKey
checkApprovedOnlyModeStatus, getAlgorithm, getL, isThreadCorrectMode, zeroizeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Key
getAlgorithm
-
Constructor Details
-
AsymmetricLMSPrivateKey
public AsymmetricLMSPrivateKey(int levels, byte[] keyData, byte[] publicData) -
AsymmetricLMSPrivateKey
Construct a key from an encoding of a PrivateKeyInfo.- Parameters:
encoding- the DER encoding of the key.- Throws:
IOException
-
AsymmetricLMSPrivateKey
Construct a key from a PrivateKeyInfo.- Parameters:
keyInfo- the PrivateKeyInfo containing the key.- Throws:
IOException
-
-
Method Details
-
getUsagesRemaining
public long getUsagesRemaining() -
getIndex
public long getIndex() -
getSecret
public byte[] getSecret() -
getPublicData
public byte[] getPublicData() -
extractKeyShard
-
getEncoded
public byte[] getEncoded()Description copied from interface:AsymmetricKeyReturn an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.- Specified by:
getEncodedin interfaceAsymmetricKey- Returns:
- an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-
equals
-
hashCode
-
getContextBasedSigner
-