Package org.bouncycastle.pqc.crypto.xmss
Class XMSS
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.xmss.XMSS
-
public class XMSS extends java.lang.ObjectXMSS.
-
-
Constructor Summary
Constructors Constructor Description XMSS(XMSSParameters params, java.security.SecureRandom prng)XMSS constructor...
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMSSPrivateKeyParametersexportPrivateKey()Export XMSS private key.XMSSPublicKeyParametersexportPublicKey()Export XMSS public key.voidgenerateKeys()Generate a new XMSS private key / public key pair.intgetIndex()Getter XMSS index.XMSSParametersgetParams()Getter XMSS params.XMSSPrivateKeyParametersgetPrivateKey()byte[]getPublicSeed()Getter XMSS public seed.byte[]getRoot()Getter XMSS root.protected org.bouncycastle.pqc.crypto.xmss.WOTSPlusgetWOTSPlus()Getter WOTS+.voidimportState(byte[] privateKey, byte[] publicKey)Import XMSS private key / public key pair.voidimportState(XMSSPrivateKeyParameters privateKey, XMSSPublicKeyParameters publicKey)protected voidsetIndex(int index)protected voidsetPublicSeed(byte[] publicSeed)protected voidsetRoot(byte[] root)byte[]sign(byte[] message)Sign message.booleanverifySignature(byte[] message, byte[] signature, byte[] publicKey)Verify an XMSS signature.protected org.bouncycastle.pqc.crypto.xmss.WOTSPlusSignaturewotsSign(byte[] messageDigest, org.bouncycastle.pqc.crypto.xmss.OTSHashAddress otsHashAddress)Generate a WOTS+ signature on a message without the corresponding authentication path
-
-
-
Constructor Detail
-
XMSS
public XMSS(XMSSParameters params, java.security.SecureRandom prng)
XMSS constructor...- Parameters:
params- XMSSParameters.
-
-
Method Detail
-
generateKeys
public void generateKeys()
Generate a new XMSS private key / public key pair.
-
importState
public void importState(XMSSPrivateKeyParameters privateKey, XMSSPublicKeyParameters publicKey)
-
importState
public void importState(byte[] privateKey, byte[] publicKey)Import XMSS private key / public key pair.- Parameters:
privateKey- XMSS private key.publicKey- XMSS public key.
-
sign
public byte[] sign(byte[] message)
Sign message.- Parameters:
message- Message to sign.- Returns:
- XMSS signature on digest of message.
-
verifySignature
public boolean verifySignature(byte[] message, byte[] signature, byte[] publicKey) throws java.text.ParseExceptionVerify an XMSS signature.- Parameters:
message- Message.signature- XMSS signature.publicKey- XMSS public key.- Returns:
- true if signature is valid false else.
- Throws:
java.text.ParseException
-
exportPrivateKey
public XMSSPrivateKeyParameters exportPrivateKey()
Export XMSS private key.- Returns:
- XMSS private key.
-
exportPublicKey
public XMSSPublicKeyParameters exportPublicKey()
Export XMSS public key.- Returns:
- XMSS public key.
-
wotsSign
protected org.bouncycastle.pqc.crypto.xmss.WOTSPlusSignature wotsSign(byte[] messageDigest, org.bouncycastle.pqc.crypto.xmss.OTSHashAddress otsHashAddress)Generate a WOTS+ signature on a message without the corresponding authentication path- Parameters:
messageDigest- Message digest of length n.otsHashAddress- OTS hash address.- Returns:
- XMSS signature.
-
getParams
public XMSSParameters getParams()
Getter XMSS params.- Returns:
- XMSS params.
-
getWOTSPlus
protected org.bouncycastle.pqc.crypto.xmss.WOTSPlus getWOTSPlus()
Getter WOTS+.- Returns:
- WOTS+ instance.
-
getRoot
public byte[] getRoot()
Getter XMSS root.- Returns:
- Root of binary tree.
-
setRoot
protected void setRoot(byte[] root)
-
getIndex
public int getIndex()
Getter XMSS index.- Returns:
- Index.
-
setIndex
protected void setIndex(int index)
-
getPublicSeed
public byte[] getPublicSeed()
Getter XMSS public seed.- Returns:
- Public seed.
-
setPublicSeed
protected void setPublicSeed(byte[] publicSeed)
-
getPrivateKey
public XMSSPrivateKeyParameters getPrivateKey()
-
-