public class XMSSSignatureSpi extends java.security.Signature implements StateAwareSignature
| Modifier and Type | Class and Description |
|---|---|
static class |
XMSSSignatureSpi.generic |
static class |
XMSSSignatureSpi.withSha256 |
static class |
XMSSSignatureSpi.withSha256andPrehash |
static class |
XMSSSignatureSpi.withSha512 |
static class |
XMSSSignatureSpi.withSha512andPrehash |
static class |
XMSSSignatureSpi.withShake128 |
static class |
XMSSSignatureSpi.withShake128_512andPrehash |
static class |
XMSSSignatureSpi.withShake128andPrehash |
static class |
XMSSSignatureSpi.withShake256 |
static class |
XMSSSignatureSpi.withShake256_1024andPrehash |
static class |
XMSSSignatureSpi.withShake256andPrehash |
| Modifier | Constructor and Description |
|---|---|
protected |
XMSSSignatureSpi(java.lang.String algorithm) |
protected |
XMSSSignatureSpi(java.lang.String sigName,
Digest digest,
XMSSSigner signer) |
protected |
XMSSSignatureSpi(java.lang.String sigName,
Digest digest,
XMSSSigner signer,
ASN1ObjectIdentifier[] treeDigests) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
engineGetParameter(java.lang.String param)
Deprecated.
|
protected void |
engineInitSign(java.security.PrivateKey privateKey) |
protected void |
engineInitSign(java.security.PrivateKey privateKey,
java.security.SecureRandom random) |
protected void |
engineInitVerify(java.security.PublicKey publicKey) |
protected void |
engineSetParameter(java.security.spec.AlgorithmParameterSpec params) |
protected void |
engineSetParameter(java.lang.String param,
java.lang.Object value)
Deprecated.
replaced with #engineSetParameter(java.security.spec.AlgorithmParameterSpec)
|
protected byte[] |
engineSign() |
protected void |
engineUpdate(byte b) |
protected void |
engineUpdate(byte[] b,
int off,
int len) |
protected boolean |
engineVerify(byte[] sigBytes) |
java.security.PrivateKey |
getUpdatedPrivateKey()
Return the current version of the private key with the updated state.
|
boolean |
isSigningCapable()
Return true if this Signature object can be used for signing.
|
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verifyengineGetParameters, engineSign, engineUpdate, engineVerifyequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAlgorithm, initSign, initSign, initVerify, initVerify, sign, sign, update, update, update, update, verify, verifyprotected XMSSSignatureSpi(java.lang.String algorithm)
protected XMSSSignatureSpi(java.lang.String sigName,
Digest digest,
XMSSSigner signer)
protected XMSSSignatureSpi(java.lang.String sigName,
Digest digest,
XMSSSigner signer,
ASN1ObjectIdentifier[] treeDigests)
protected void engineInitVerify(java.security.PublicKey publicKey)
throws java.security.InvalidKeyException
engineInitVerify in class java.security.SignatureSpijava.security.InvalidKeyExceptionprotected void engineInitSign(java.security.PrivateKey privateKey,
java.security.SecureRandom random)
throws java.security.InvalidKeyException
engineInitSign in class java.security.SignatureSpijava.security.InvalidKeyExceptionprotected void engineInitSign(java.security.PrivateKey privateKey)
throws java.security.InvalidKeyException
engineInitSign in class java.security.SignatureSpijava.security.InvalidKeyExceptionprotected void engineUpdate(byte b)
throws java.security.SignatureException
engineUpdate in class java.security.SignatureSpijava.security.SignatureExceptionprotected void engineUpdate(byte[] b,
int off,
int len)
throws java.security.SignatureException
engineUpdate in class java.security.SignatureSpijava.security.SignatureExceptionprotected byte[] engineSign()
throws java.security.SignatureException
engineSign in class java.security.SignatureSpijava.security.SignatureExceptionprotected boolean engineVerify(byte[] sigBytes)
throws java.security.SignatureException
engineVerify in class java.security.SignatureSpijava.security.SignatureExceptionprotected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
engineSetParameter in class java.security.SignatureSpiprotected void engineSetParameter(java.lang.String param,
java.lang.Object value)
engineSetParameter in class java.security.SignatureSpiprotected java.lang.Object engineGetParameter(java.lang.String param)
engineGetParameter in class java.security.SignatureSpipublic boolean isSigningCapable()
StateAwareSignatureisSigningCapable in interface StateAwareSignaturepublic java.security.PrivateKey getUpdatedPrivateKey()
StateAwareSignatureNote: 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.
getUpdatedPrivateKey in interface StateAwareSignature