Package org.bouncycastle.pqc.crypto.lms
Class LMSPrivateKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.pqc.crypto.lms.LMSKeyParameters
org.bouncycastle.pqc.crypto.lms.LMSPrivateKeyParameters
- All Implemented Interfaces:
CipherParameters
,LMSContextBasedSigner
,Encodable
-
Constructor Summary
ConstructorDescriptionLMSPrivateKeyParameters
(LMSigParameters lmsParameter, LMOtsParameters otsParameters, int q, byte[] I, int maxQ, byte[] masterSecret) -
Method Summary
Modifier and TypeMethodDescriptionboolean
extractKeyShard
(int usageCount) Return a key that can be used usageCount times.byte[]
generateSignature
(LMSContext context) byte[]
Return a byte array representing the implementing object.byte[]
getI()
int
getIndex()
Return the key index (the q value).static LMSPrivateKeyParameters
getInstance
(byte[] privEnc, byte[] pubEnc) static LMSPrivateKeyParameters
getInstance
(Object src) byte[]
long
int
hashCode()
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
Constructor Details
-
LMSPrivateKeyParameters
public LMSPrivateKeyParameters(LMSigParameters lmsParameter, LMOtsParameters otsParameters, int q, byte[] I, int maxQ, byte[] masterSecret)
-
-
Method Details
-
getInstance
- Throws:
IOException
-
getInstance
- Throws:
IOException
-
getIndex
public int getIndex()Return the key index (the q value).- Returns:
- private key index number.
-
generateLMSContext
- Specified by:
generateLMSContext
in interfaceLMSContextBasedSigner
-
generateSignature
- Specified by:
generateSignature
in 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.
-
getSigParameters
-
getOtsParameters
-
getI
public byte[] getI() -
getMasterSecret
public byte[] getMasterSecret() -
getUsagesRemaining
public long getUsagesRemaining()- Specified by:
getUsagesRemaining
in interfaceLMSContextBasedSigner
-
getPublicKey
-
equals
-
hashCode
public int hashCode() -
getEncoded
Description copied from interface:Encodable
Return a byte array representing the implementing object.- Specified by:
getEncoded
in interfaceEncodable
- Specified by:
getEncoded
in classLMSKeyParameters
- Returns:
- a byte array representing the encoding.
- Throws:
IOException
- if an issue arises generation the encoding.
-