Class XMSSSignatureSpi

java.lang.Object
java.security.SignatureSpi
java.security.Signature
org.bouncycastle.pqc.jcajce.provider.xmss.XMSSSignatureSpi
All Implemented Interfaces:
StateAwareSignature
Direct Known Subclasses:
XMSSSignatureSpi.generic, XMSSSignatureSpi.withSha256, XMSSSignatureSpi.withSha256andPrehash, XMSSSignatureSpi.withSha512, XMSSSignatureSpi.withSha512andPrehash, XMSSSignatureSpi.withShake128, XMSSSignatureSpi.withShake128_512andPrehash, XMSSSignatureSpi.withShake128andPrehash, XMSSSignatureSpi.withShake256, XMSSSignatureSpi.withShake256_1024andPrehash, XMSSSignatureSpi.withShake256andPrehash

@Deprecated public class XMSSSignatureSpi extends Signature implements StateAwareSignature
Deprecated.
use XMSSSignatureSpi instead.
  • Constructor Details

  • Method Details

    • engineInitVerify

      protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
      Deprecated.
      Specified by:
      engineInitVerify in class SignatureSpi
      Throws:
      InvalidKeyException
    • engineInitSign

      protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException
      Deprecated.
      Overrides:
      engineInitSign in class SignatureSpi
      Throws:
      InvalidKeyException
    • engineInitSign

      protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
      Deprecated.
      Specified by:
      engineInitSign in class SignatureSpi
      Throws:
      InvalidKeyException
    • engineUpdate

      protected void engineUpdate(byte b) throws SignatureException
      Deprecated.
      Specified by:
      engineUpdate in class SignatureSpi
      Throws:
      SignatureException
    • engineUpdate

      protected void engineUpdate(byte[] b, int off, int len) throws SignatureException
      Deprecated.
      Specified by:
      engineUpdate in class SignatureSpi
      Throws:
      SignatureException
    • engineSign

      protected byte[] engineSign() throws SignatureException
      Deprecated.
      Specified by:
      engineSign in class SignatureSpi
      Throws:
      SignatureException
    • engineVerify

      protected boolean engineVerify(byte[] sigBytes) throws SignatureException
      Deprecated.
      Specified by:
      engineVerify in class SignatureSpi
      Throws:
      SignatureException
    • engineSetParameter

      protected void engineSetParameter(AlgorithmParameterSpec params)
      Deprecated.
      Overrides:
      engineSetParameter in class SignatureSpi
    • engineSetParameter

      protected void engineSetParameter(String param, Object value)
      Deprecated.
      replaced with #engineSetParameter(java.security.spec.AlgorithmParameterSpec)
      Specified by:
      engineSetParameter in class SignatureSpi
    • engineGetParameter

      protected Object engineGetParameter(String param)
      Deprecated.
      Specified by:
      engineGetParameter in class SignatureSpi
    • isSigningCapable

      public boolean isSigningCapable()
      Deprecated.
      Description copied from interface: StateAwareSignature
      Return true if this Signature object can be used for signing. False otherwise.
      Specified by:
      isSigningCapable in interface StateAwareSignature
      Returns:
      true if we are capable of making signatures.
    • getUpdatedPrivateKey

      public PrivateKey getUpdatedPrivateKey()
      Deprecated.
      Description copied from interface: StateAwareSignature
      Return the current version of the private key with the updated state.

      Note: what this leaves behind depends on whether a signature has been generated since initSign(). After one, the key handed back is the key that signature spent and the Signature object keeps nothing: it cannot generate another signature without a further call to initSign(), and a second call to this method throws. Before one, the object keeps a single usage to sign with and hands back the rest, so it remains capable of exactly one signature - that is the whole point of collecting first, since the state a caller is obliged to persist is then durable before the one-time key covering it is spent. A second call in that state hands back the same key again rather than a further shard.

      Collecting first and then signing joins the two: the signature spends the one usage the object kept, and a collection after it throws rather than handing that spent shard over. Everything the caller has to store it was given by the first collection, and the shard adds nothing to it - so a caller that collects in a finally beside an explicit collection is refused instead of overwriting the remainder with a key reporting nothing remaining.

      The key that comes back may report no usages remaining - a Signature object initialised on a spent key still has state its caller has to store - so a non-null return is not on its own a statement that anything is left to sign with. StateAwareSignature.isSigningCapable() is what answers that, and the two do differ in that case.

      Specified by:
      getUpdatedPrivateKey in interface StateAwareSignature
      Returns:
      an updated private key object, which can be used for later signature generation.