org.bouncycastle.pqc.jcajce.interfaces
Interface StateAwareSignature
- public interface StateAwareSignature
This interface is implemented by Signature classes returned by the PQC provider where the signature
algorithm is one where the private key is updated for each signature generated. Examples of these
are algorithms such as GMSS, XMSS, and XMSS^MT.
Method Summary |
java.lang.String |
getAlgorithm()
|
java.security.PrivateKey |
getUpdatedPrivateKey()
Return the current version of the private key with the updated state. |
void |
initSign(java.security.PrivateKey privateKey)
|
void |
initSign(java.security.PrivateKey privateKey,
java.security.SecureRandom random)
|
void |
initVerify(java.security.cert.Certificate certificate)
|
void |
initVerify(java.security.PublicKey publicKey)
|
byte[] |
sign()
|
int |
sign(byte[] outbuf,
int offset,
int len)
|
void |
update(byte b)
|
void |
update(byte[] data)
|
void |
update(byte[] data,
int off,
int len)
|
boolean |
verify(byte[] signature)
|
boolean |
verify(byte[] signature,
int offset,
int length)
|
initVerify
public void initVerify(java.security.PublicKey publicKey)
throws java.security.InvalidKeyException
initVerify
public void initVerify(java.security.cert.Certificate certificate)
throws java.security.InvalidKeyException
initSign
public void initSign(java.security.PrivateKey privateKey)
throws java.security.InvalidKeyException
initSign
public void initSign(java.security.PrivateKey privateKey,
java.security.SecureRandom random)
throws java.security.InvalidKeyException
sign
public byte[] sign()
throws java.security.SignatureException
sign
public int sign(byte[] outbuf,
int offset,
int len)
throws java.security.SignatureException
verify
public boolean verify(byte[] signature)
throws java.security.SignatureException
verify
public boolean verify(byte[] signature,
int offset,
int length)
throws java.security.SignatureException
update
public void update(byte b)
throws java.security.SignatureException
update
public void update(byte[] data)
throws java.security.SignatureException
update
public void update(byte[] data,
int off,
int len)
throws java.security.SignatureException
getAlgorithm
public java.lang.String getAlgorithm()
getUpdatedPrivateKey
public java.security.PrivateKey getUpdatedPrivateKey()
- Return the current version of the private key with the updated state.
Note: calling this method will effectively disable the Signature object from being used for further
signature generation without another call to init().
- Returns:
- an updated private key object, which can be used for later signature generation.