public class BCLMSPrivateKey extends java.lang.Object implements LMSPrivateKey, javax.security.auth.Destroyable
| Constructor and Description |
|---|
BCLMSPrivateKey(LMSKeyParameters keyParams) |
BCLMSPrivateKey(PrivateKeyInfo keyInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this key, zeroizing the secret key material it holds.
|
boolean |
equals(java.lang.Object o) |
BCLMSPrivateKey |
extractKeyShard(int usageCount)
Return a key representing a shard of the key space that can be used usageCount times.
|
java.lang.String |
getAlgorithm() |
byte[] |
getEncoded() |
java.lang.String |
getFormat() |
long |
getIndex()
Return the index of the next signature.
|
int |
getLevels()
Return the number of levels (L) associated with the key.
|
long |
getUsagesRemaining()
Return the number of usages left for the private key.
|
int |
hashCode() |
boolean |
isDestroyed() |
public BCLMSPrivateKey(LMSKeyParameters keyParams)
public BCLMSPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
java.io.IOExceptionpublic long getIndex()
LMSPrivateKeygetIndex in interface LMSPrivateKeypublic long getUsagesRemaining()
LMSPrivateKeygetUsagesRemaining in interface LMSPrivateKeypublic BCLMSPrivateKey extractKeyShard(int usageCount)
LMSPrivateKeyNote: this will use the range [index...index + usageCount) for the current key.
extractKeyShard in interface LMSPrivateKeyusageCount - the number of usages the key should have.public java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Keypublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int getLevels()
LMSKeypublic void destroy()
The master secret of every tree in the hierarchy is zeroized; the key identifiers, indexes,
chaining signatures and cached tree nodes are retained, so getIndex(),
getUsagesRemaining() and getLevels() keep working. After destruction
isDestroyed() returns true, getEncoded() and extractKeyShard(int)
throw IllegalStateException, the key can no longer be serialized, and a Signature
refuses it at initSign. Shards extracted before destruction are independent copies and are
unaffected. As the underlying HSSPrivateKeyParameters object is destroyed, keys
sharing it are invalidated too.
destroy in interface javax.security.auth.Destroyablepublic boolean isDestroyed()
isDestroyed in interface javax.security.auth.Destroyable