Class HSSPrivateKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.crypto.params.LMSKeyParameters
org.bouncycastle.crypto.params.HSSPrivateKeyParameters
- All Implemented Interfaces:
Destroyable, CipherParameters, LMSContextBasedSigner, Encodable
public class HSSPrivateKeyParameters
extends LMSKeyParameters
implements LMSContextBasedSigner, Destroyable
-
Constructor Summary
ConstructorsConstructorDescriptionHSSPrivateKeyParameters(int l, List<LMSPrivateKeyParameters> keys, List<LMSSignature> sig, long index, long indexLimit) HSSPrivateKeyParameters(LMSPrivateKeyParameters key, long index, long indexLimit) -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone()voiddestroy()Destroy this key, zeroizing the master secret of every tree in the hierarchy.booleanextractKeyShard(int usageCount) Return a key that can be used usageCount times.byte[]generateSignature(LMSContext context) byte[]Return a byte array representing the implementing object.longgetIndex()longReturn the index one past the last this key may sign with.static HSSPrivateKeyParametersgetInstance(byte[] privEnc, byte[] pubEnc) static HSSPrivateKeyParametersgetInstance(Object src) intgetL()longinthashCode()booleanbooleanisShard()Return true if this key was split off another withextractKeyShard(int)and so covers a sub-range of that key's indexes.Methods inherited from class AsymmetricKeyParameter
isPrivate
-
Constructor Details
-
HSSPrivateKeyParameters
-
HSSPrivateKeyParameters
public HSSPrivateKeyParameters(int l, List<LMSPrivateKeyParameters> keys, List<LMSSignature> sig, long index, long indexLimit)
-
-
Method Details
-
getInstance
- Throws:
IOException
-
getInstance
- Throws:
IOException
-
getL
public int getL() -
getIndex
public long getIndex() -
getLMSParameters
-
isShard
public boolean isShard()Return true if this key was split off another withextractKeyShard(int)and so covers a sub-range of that key's indexes. -
getIndexLimit
public long getIndexLimit()Return the index one past the last this key may sign with. -
getUsagesRemaining
public long getUsagesRemaining()- Specified by:
getUsagesRemainingin interfaceLMSContextBasedSigner
-
extractKeyShard
Return a key that can be used usageCount times.Note: this will use the range [index...index + usageCount) for the current key.
- Parameters:
usageCount- the number of usages the key should have.- Returns:
- a key based on the current key that can be used usageCount times.
-
getPublicKey
-
equals
-
getEncoded
Description copied from interface:EncodableReturn a byte array representing the implementing object.- Specified by:
getEncodedin interfaceEncodable- Specified by:
getEncodedin classLMSKeyParameters- Returns:
- a byte array representing the encoding.
- Throws:
IOException- if an issue arises generation the encoding.
-
hashCode
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
generateLMSContext
- Specified by:
generateLMSContextin interfaceLMSContextBasedSigner
-
generateSignature
- Specified by:
generateSignaturein interfaceLMSContextBasedSigner
-
destroy
public void destroy()Destroy this key, zeroizing the master secret of every tree in the hierarchy.The chaining signatures, the indexes and the component keys' identifiers and cached tree nodes are retained - none of them is secret, and the public key stays derivable where the root tree's root node is already cached. After destruction
isDestroyed()returns true andgetEncoded(),generateLMSContext()andextractKeyShard(int)throwIllegalStateException; a signature attempt fails before its index is claimed. Shards split off this key before it was destroyed are independent copies and are unaffected.- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-