Class BCXMSSMTPrivateKey
- java.lang.Object
-
- org.bouncycastle.pqc.jcajce.provider.xmss.BCXMSSMTPrivateKey
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Key,java.security.PrivateKey,javax.security.auth.Destroyable,XMSSMTKey,XMSSMTPrivateKey
public class BCXMSSMTPrivateKey extends java.lang.Object implements java.security.PrivateKey, XMSSMTPrivateKey
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BCXMSSMTPrivateKey(ASN1ObjectIdentifier treeDigest, XMSSMTPrivateKeyParameters keyParams)BCXMSSMTPrivateKey(PrivateKeyInfo keyInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)XMSSMTPrivateKeyextractKeyShard(int usageCount)Return a key representing a shard of the key space that can be used usageCount times.java.lang.StringgetAlgorithm()byte[]getEncoded()java.lang.StringgetFormat()intgetHeight()longgetIndex()Return the index of the next signature.intgetLayers()java.lang.StringgetTreeDigest()longgetUsagesRemaining()Return the number of usages left for the private key.inthashCode()
-
-
-
Constructor Detail
-
BCXMSSMTPrivateKey
public BCXMSSMTPrivateKey(ASN1ObjectIdentifier treeDigest, XMSSMTPrivateKeyParameters keyParams)
-
BCXMSSMTPrivateKey
public BCXMSSMTPrivateKey(PrivateKeyInfo keyInfo) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getIndex
public long getIndex()
Description copied from interface:XMSSMTPrivateKeyReturn the index of the next signature.- Specified by:
getIndexin interfaceXMSSMTPrivateKey- Returns:
- the index number for the next signature.
-
getUsagesRemaining
public long getUsagesRemaining()
Description copied from interface:XMSSMTPrivateKeyReturn the number of usages left for the private key.- Specified by:
getUsagesRemainingin interfaceXMSSMTPrivateKey- Returns:
- the number of times the key can be used before it is exhausted.
-
extractKeyShard
public XMSSMTPrivateKey extractKeyShard(int usageCount)
Description copied from interface:XMSSMTPrivateKeyReturn 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:
extractKeyShardin interfaceXMSSMTPrivateKey- 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 java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfacejava.security.Key
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfacejava.security.Key
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getTreeDigest
public java.lang.String getTreeDigest()
- Specified by:
getTreeDigestin interfaceXMSSMTKey
-
-