forked from rtyley/spongycastle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
160 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
prov/src/main/jdk1.3/org/bouncycastle/pqc/jcajce/interfaces/StateAwareSignature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.bouncycastle.pqc.jcajce.interfaces; | ||
|
||
import java.security.InvalidKeyException; | ||
import java.security.PrivateKey; | ||
import java.security.PublicKey; | ||
import java.security.SecureRandom; | ||
import java.security.SignatureException; | ||
import java.security.cert.Certificate; | ||
|
||
/** | ||
* 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. | ||
*/ | ||
public interface StateAwareSignature | ||
{ | ||
void initVerify(PublicKey publicKey) | ||
throws InvalidKeyException; | ||
|
||
void initVerify(Certificate certificate) | ||
throws InvalidKeyException; | ||
|
||
void initSign(PrivateKey privateKey) | ||
throws InvalidKeyException; | ||
|
||
void initSign(PrivateKey privateKey, SecureRandom random) | ||
throws InvalidKeyException; | ||
|
||
byte[] sign() | ||
throws SignatureException; | ||
|
||
int sign(byte[] outbuf, int offset, int len) | ||
throws SignatureException; | ||
|
||
boolean verify(byte[] signature) | ||
throws SignatureException; | ||
|
||
boolean verify(byte[] signature, int offset, int length) | ||
throws SignatureException; | ||
|
||
void update(byte b) | ||
throws SignatureException; | ||
|
||
void update(byte[] data) | ||
throws SignatureException; | ||
|
||
void update(byte[] data, int off, int len) | ||
throws SignatureException; | ||
|
||
String getAlgorithm(); | ||
|
||
/** | ||
* Return the current version of the private key with the updated state. | ||
* <p> | ||
* <b>Note:</b> calling this method will effectively disable the Signature object from being used for further | ||
* signature generation without another call to init(). | ||
* </p> | ||
* @return an updated private key object, which can be used for later signature generation. | ||
*/ | ||
PrivateKey getUpdatedPrivateKey(); | ||
} |