public class LMSPrivateKeyParameters extends LMSKeyParameters implements LMSContextBasedSigner, javax.security.auth.Destroyable
| Modifier | Constructor and Description |
|---|---|
protected |
LMSPrivateKeyParameters(LMSigParameters lmsParameter,
LMOtsParameters otsParameters,
int maxQ)
A key with no position, identifier or seed of its own - the placeholder an HSS hierarchy is
built with for the levels below the root, each of which resetKeyToIndex replaces from the
level above before the key is used.
|
|
LMSPrivateKeyParameters(LMSigParameters lmsParameter,
LMOtsParameters otsParameters,
int q,
byte[] I,
int maxQ,
byte[] masterSecret) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this key, zeroizing the master secret it holds.
|
boolean |
equals(java.lang.Object o) |
LMSPrivateKeyParameters |
extractKeyShard(int usageCount)
Return a key that can be used usageCount times.
|
LMSContext |
generateLMSContext() |
byte[] |
generateSignature(LMSContext context) |
byte[] |
getEncoded()
Return a byte array representing the implementing object.
|
byte[] |
getI() |
int |
getIndex()
Return the key index (the q value).
|
int |
getIndexLimit() |
static LMSPrivateKeyParameters |
getInstance(byte[] privEnc,
byte[] pubEnc) |
static LMSPrivateKeyParameters |
getInstance(java.lang.Object src) |
byte[] |
getMasterSecret() |
LMOtsParameters |
getOtsParameters() |
LMSPublicKeyParameters |
getPublicKey() |
LMSigParameters |
getSigParameters() |
long |
getUsagesRemaining() |
int |
hashCode() |
boolean |
isDestroyed() |
isPrivatepublic LMSPrivateKeyParameters(LMSigParameters lmsParameter, LMOtsParameters otsParameters, int q, byte[] I, int maxQ, byte[] masterSecret)
protected LMSPrivateKeyParameters(LMSigParameters lmsParameter, LMOtsParameters otsParameters, int maxQ)
public static LMSPrivateKeyParameters getInstance(byte[] privEnc, byte[] pubEnc) throws java.io.IOException
java.io.IOExceptionpublic static LMSPrivateKeyParameters getInstance(java.lang.Object src) throws java.io.IOException
java.io.IOExceptionpublic int getIndex()
public LMSContext generateLMSContext()
generateLMSContext in interface LMSContextBasedSignerpublic byte[] generateSignature(LMSContext context)
generateSignature in interface LMSContextBasedSignerpublic LMSPrivateKeyParameters extractKeyShard(int usageCount)
Note: this will use the range [index...index + usageCount) for the current key.
usageCount - the number of usages the key should have.public LMSigParameters getSigParameters()
public LMOtsParameters getOtsParameters()
public byte[] getI()
public byte[] getMasterSecret()
public void destroy()
The key identifier I, the parameter sets, the index and the cached Merkle tree nodes are
retained - none of them is secret, and the public key stays derivable where the tree's
root is already cached. After destruction isDestroyed() returns true and
getMasterSecret(), getEncoded(), generateLMSContext() and the
derivation of child trees throw IllegalStateException; a signature attempt fails
before its one-time index is claimed. Note: keys repositioned within this tree or split
off it with extractKeyShard(int) share its master secret array, so destroying
this key invalidates them too.
destroy in interface javax.security.auth.Destroyablepublic boolean isDestroyed()
isDestroyed in interface javax.security.auth.Destroyablepublic int getIndexLimit()
public long getUsagesRemaining()
getUsagesRemaining in interface LMSContextBasedSignerpublic LMSPublicKeyParameters getPublicKey()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic byte[] getEncoded()
throws java.io.IOException
EncodablegetEncoded in interface EncodablegetEncoded in class LMSKeyParametersjava.io.IOException - if an issue arises generation the encoding.