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
ConstructorsConstructorDescriptionLMSPrivateKeyParameters(LMSigParameters lmsParameter, LMOtsParameters otsParameters, int q, byte[] I, int maxQ, byte[] masterSecret) -
Method Summary
Modifier and TypeMethodDescriptionbooleanextractKeyShard(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()intgetIndex()Return the key index (the q value).intstatic LMSPrivateKeyParametersgetInstance(byte[] privEnc, byte[] pubEnc) static LMSPrivateKeyParametersgetInstance(Object src) byte[]longinthashCode()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:
generateLMSContextin interfaceLMSContextBasedSigner
-
generateSignature
- Specified by:
generateSignaturein 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() -
getIndexLimit
public int getIndexLimit() -
getUsagesRemaining
public long getUsagesRemaining()- Specified by:
getUsagesRemainingin interfaceLMSContextBasedSigner
-
getPublicKey
-
equals
-
hashCode
public int hashCode() -
getEncoded
Description copied from interface:EncodableReturn a byte array representing the implementing object.- Specified by:
getEncodedin interfaceEncodable- Specified by:
getEncodedin classLMSKeyParameters- Returns:
- a byte array representing the encoding.
- Throws:
IOException- if an issue arises generation the encoding.
-