|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.security.SignatureSpi
|
+--de.flexiprovider.api.Signature
|
+--de.flexiprovider.nf.iq.iqrdsa.IQRDSASignature
The IQRDSASignature class implements core parts of the IQRDSA algorithm, namely the signature and the verification process.
Signature is generated as follow
The signature of the message M is S = (s, rho, lambda)
Verification of a given signature only succeeds if the following equation is fulfilled:
gamma^s * alpha^h(M||rho) * lambda^q = rho with 1 <= s < q
| Inner Class Summary | |
static class |
IQRDSASignature.RIPEMD160
IQRDSA with RIPEMD160 message digest. |
static class |
IQRDSASignature.SHA1
IQRDSA with SHA1 message digest. |
| Fields inherited from class java.security.SignatureSpi |
appRandom |
| Constructor Summary | |
protected |
IQRDSASignature(MessageDigest md)
Constructor. |
| Method Summary | |
void |
initSign(PrivateKey key,
SecureRandom prng)
Initializes engine for signing. |
void |
initVerify(PublicKey key)
Initialized engine for verification process |
protected byte[] |
makeDigest(byte[] m)
Calculates the digest value for a given octet string |
void |
setParameters(AlgorithmParameterSpec params)
Set the parameters for the signature. |
byte[] |
sign()
Generates an ASN.1 encoded object representing the signature of the data bytes digested by the message digest algorithm thus far. |
void |
update(byte b)
Updates the data to be signed or verified using the specified byte. |
void |
update(byte[] b,
int off,
int len)
Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset. |
boolean |
verify(byte[] sigBytes)
Verifies the signature passed in as sigBytes |
| Methods inherited from class de.flexiprovider.api.Signature |
engineGetParameter, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineUpdate, engineUpdate, engineVerify, engineVerify, initSign, sign, update, verify, verify, verify |
| Methods inherited from class java.security.SignatureSpi |
clone, engineSign |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
protected IQRDSASignature(MessageDigest md)
md - the message digest| Method Detail |
public void initSign(PrivateKey key, SecureRandom prng) throws InvalidKeyException
key - private key to be used for signingprng - source of randomnessInvalidKeyException - if the key is not an instance of IQRDSAPrivateKey.sign()public void initVerify(PublicKey key) throws InvalidKeyException
initVerify in class Signaturekey - public key to be used for verificationInvalidKeyException - if the key is not an instance of IQRDSAPublicKey.verify(byte [])public void update(byte b)
b - the byte to be updated.
public void update(byte[] b,
int off,
int len)
b - the byte arrayoff - the offset to start from in the array of byteslen - the number of bytes to use, starting at offsetprotected byte[] makeDigest(byte[] m)
m - array containing the data to be hashedpublic byte[] sign()
public boolean verify(byte[] sigBytes)
throws SignatureException
sigBytes - the signature bytes to be verified.SignatureException - if this signature object is not initialized properly.public void setParameters(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
setParameters in class Signatureparams - the parametersInvalidAlgorithmParameterException - if the parameters are not an instance of
IQRDSAParameterSpec.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||