|
|||||||||
| 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.iqdsa.IQDSASignature
This class implements the core parts of the IQDSA algorithm, namely the signature and the verification process.
| Inner Class Summary | |
static class |
IQDSASignature.RIPEMD160
IQDSA with RIPEMD160 message digest. |
static class |
IQDSASignature.SHA1
IQDSA with SHA1 message digest. |
| Fields inherited from class java.security.SignatureSpi |
appRandom |
| Constructor Summary | |
protected |
IQDSASignature(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 IQDSASignature(MessageDigest md)
md - the message digest| Method Detail |
public void initSign(PrivateKey key,
SecureRandom prng)
throws InvalidKeyException
initSign in class Signaturekey - private key to be used for signingprng - source of randomnessInvalidKeyException - if the key is not an instance of IQDSAPrivateKey.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 IQDSAPublicKey.verify(byte [])public void update(byte b)
update in class Signatureb - the byte to be updated.
public void update(byte[] b,
int off,
int len)
update in class Signatureb - 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()
sign in class Signature
public boolean verify(byte[] sigBytes)
throws SignatureException
verify in class SignaturesigBytes - 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
IQDSAParameterSpec.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||