public class EdDSAEngine extends Signature
| Modifier and Type | Field and Description |
|---|---|
protected MessageDigest |
digest |
static AlgorithmParameterSpec |
ONE_SHOT_MODE
To efficiently sign or verify data in one shot, pass this to setParameters()
after initSign() or initVerify() but BEFORE THE FIRST AND ONLY
update(data) or update(data, off, len).
|
static String |
SIGNATURE_ALGORITHM |
SIGN, state, UNINITIALIZED, VERIFYappRandom| Constructor and Description |
|---|
EdDSAEngine()
No specific EdDSA-internal hash requested, allows any EdDSA key.
|
EdDSAEngine(MessageDigest digest)
Specific EdDSA-internal hash requested, only matching keys will be allowed.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
digestInitSign(EdDSAPrivateKey privKey) |
protected void |
engineInitSign(PrivateKey privateKey) |
protected void |
engineInitVerify(PublicKey publicKey) |
protected void |
engineSetParameter(AlgorithmParameterSpec spec) |
protected byte[] |
engineSign() |
protected void |
engineUpdate(byte b) |
protected void |
engineUpdate(byte[] b,
int off,
int len) |
protected boolean |
engineVerify(byte[] sigBytes) |
byte[] |
signOneShot(byte[] data)
To efficiently sign all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
byte[] |
signOneShot(byte[] data,
int off,
int len)
To efficiently sign all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
boolean |
verifyOneShot(byte[] data,
byte[] signature)
To efficiently verify all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
boolean |
verifyOneShot(byte[] data,
byte[] signature,
int sigoff,
int siglen)
To efficiently verify all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
boolean |
verifyOneShot(byte[] data,
int off,
int len,
byte[] signature)
To efficiently verify all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
boolean |
verifyOneShot(byte[] data,
int off,
int len,
byte[] signature,
int sigoff,
int siglen)
To efficiently verify all the data in one shot, if it is available,
use this method, which will avoid copying the data.
|
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verifyengineGetParameter, engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerifyprotected MessageDigest digest
public static final AlgorithmParameterSpec ONE_SHOT_MODE
public static final String SIGNATURE_ALGORITHM
public EdDSAEngine()
public EdDSAEngine(MessageDigest digest)
digest - the hash algorithm that keys must have to sign or verify.protected void digestInitSign(EdDSAPrivateKey privKey)
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
engineInitSign in class SignatureSpiInvalidKeyExceptionprotected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
engineInitVerify in class SignatureSpiInvalidKeyExceptionprotected void engineSetParameter(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException
engineSetParameter in class SignatureSpiInvalidAlgorithmParameterException - if spec is ONE_SHOT_MODE and update() already calledONE_SHOT_MODEprotected byte[] engineSign()
throws SignatureException
engineSign in class SignatureSpiSignatureExceptionprotected void engineUpdate(byte b)
throws SignatureException
engineUpdate in class SignatureSpiSignatureException - if in one-shot modeprotected void engineUpdate(byte[] b,
int off,
int len)
throws SignatureException
engineUpdate in class SignatureSpiSignatureException - if one-shot rules are violatedprotected boolean engineVerify(byte[] sigBytes)
throws SignatureException
engineVerify in class SignatureSpiSignatureExceptionpublic byte[] signOneShot(byte[] data)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data) sig = sign()
data - the message to be signedSignatureException - if update() already calledONE_SHOT_MODEpublic byte[] signOneShot(byte[] data,
int off,
int len)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data, off, len) sig = sign()
data - byte array containing the message to be signedoff - the start of the message inside datalen - the length of the messageSignatureException - if update() already calledONE_SHOT_MODEpublic boolean verifyOneShot(byte[] data,
byte[] signature)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data) ok = verify(signature)
data - the message that was signedsignature - of the messageSignatureException - if update() already calledONE_SHOT_MODEpublic boolean verifyOneShot(byte[] data,
byte[] signature,
int sigoff,
int siglen)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data) ok = verify(signature, sigoff, siglen)
data - the message that was signedsignature - byte array containing the signaturesigoff - the start of the signaturesiglen - the length of the signatureSignatureException - if update() already calledONE_SHOT_MODEpublic boolean verifyOneShot(byte[] data,
int off,
int len,
byte[] signature)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data, off, len) ok = verify(signature)
data - byte array containing the message that was signedoff - the start of the message inside datalen - the length of the messagesignature - of the messageSignatureException - if update() already calledONE_SHOT_MODEpublic boolean verifyOneShot(byte[] data,
int off,
int len,
byte[] signature,
int sigoff,
int siglen)
throws SignatureException
setParameter(ONE_SHOT_MODE) update(data, off, len) ok = verify(signature, sigoff, siglen)
data - byte array containing the message that was signedoff - the start of the message inside datalen - the length of the messagesignature - byte array containing the signaturesigoff - the start of the signaturesiglen - the length of the signatureSignatureException - if update() already calledONE_SHOT_MODE