Class BCXMSSPrivateKey
- java.lang.Object
-
- org.bouncycastle.pqc.jcajce.provider.xmss.BCXMSSPrivateKey
-
- All Implemented Interfaces:
Serializable
,Key
,PrivateKey
,Destroyable
,XMSSKey
,XMSSPrivateKey
public class BCXMSSPrivateKey extends Object implements PrivateKey, XMSSPrivateKey
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCXMSSPrivateKey(ASN1ObjectIdentifier treeDigest, XMSSPrivateKeyParameters keyParams)
BCXMSSPrivateKey(PrivateKeyInfo keyInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
XMSSPrivateKey
extractKeyShard(int usageCount)
Return a key representing a shard of the key space that can be used usageCount times.String
getAlgorithm()
byte[]
getEncoded()
String
getFormat()
int
getHeight()
long
getIndex()
Return the index of the next signature.String
getTreeDigest()
long
getUsagesRemaining()
Return the number of usages left for the private key.int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
-
-
-
Constructor Detail
-
BCXMSSPrivateKey
public BCXMSSPrivateKey(ASN1ObjectIdentifier treeDigest, XMSSPrivateKeyParameters keyParams)
-
BCXMSSPrivateKey
public BCXMSSPrivateKey(PrivateKeyInfo keyInfo) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getIndex
public long getIndex()
Description copied from interface:XMSSPrivateKey
Return the index of the next signature.- Specified by:
getIndex
in interfaceXMSSPrivateKey
- Returns:
- the index number for the next signature.
-
getUsagesRemaining
public long getUsagesRemaining()
Description copied from interface:XMSSPrivateKey
Return the number of usages left for the private key.- Specified by:
getUsagesRemaining
in interfaceXMSSPrivateKey
- Returns:
- the number of times the key can be used before it is exhausted.
-
extractKeyShard
public XMSSPrivateKey extractKeyShard(int usageCount)
Description copied from interface:XMSSPrivateKey
Return a key representing a shard of the key space that can be used usageCount times.Note: this will use the range [index...index + usageCount) for the current key.
- Specified by:
extractKeyShard
in interfaceXMSSPrivateKey
- Parameters:
usageCount
- the number of usages the key should have.- Returns:
- a key based on the current key that can be used usageCount times.
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceKey
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncoded
in interfaceKey
-
getTreeDigest
public String getTreeDigest()
- Specified by:
getTreeDigest
in interfaceXMSSKey
-
-