|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.SignatureSpi java.security.Signature iaik.security.ecc.ecdsa.ECDSASignature
The signature class for the ECDSA algorithm. It is responsible for signature creation and verification. Use this class with the JCE/JCA framework.
Field Summary | |
protected java.security.MessageDigest |
md_
The message digest. |
protected ECPrivateKey |
privateKey_
The private key, used for signing. |
protected ECPublicKey |
publicKey_
The public key used for verification. |
protected java.security.SecureRandom |
secureRandom_
Source of randomness. |
Fields inherited from class java.security.Signature |
SIGN, state, UNINITIALIZED, VERIFY |
Fields inherited from class java.security.SignatureSpi |
appRandom |
Constructor Summary | |
ECDSASignature()
Applications shouldn't use this constructor, but the Signature.getInstance("ECDSA") method. |
Method Summary | |
protected java.lang.Object |
engineGetParameter(java.lang.String param)
Method not implemented. |
protected void |
engineInitSign(java.security.PrivateKey privateKey)
Initializes the engine for signature creation. |
protected void |
engineInitSign(java.security.PrivateKey privateKey,
java.security.SecureRandom random)
Initializes the engine for signature creation. |
protected void |
engineInitVerify(java.security.PublicKey publicKey)
Initializes the engine for signature verification. |
protected void |
engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
Method not implemented. |
protected void |
engineSetParameter(java.lang.String param,
java.lang.Object value)
Method not implemented. |
protected byte[] |
engineSign()
Implements the sign algorithm according to the rules: k = random([1,n-1]) kP = (x1,y1) r = x1 mod n e = H(M) s = k1(e+dr) mod n Signature: (r,s) |
protected void |
engineUpdate(byte b)
Updates the hash to be signed or verified. |
protected void |
engineUpdate(byte[] b,
int off,
int len)
SPI: Updates the data to be signed or verified with the specified number of bytes, beginning at the specified offset within the given byte array. |
protected boolean |
engineVerify(byte[] sigBytes)
Verifies a given signature according to the following rules: extract r and s from the given byte[] if r is not an integer in the interval [1, n-1] reject sig. |
Methods inherited from class java.security.Signature |
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, verify, verify |
Methods inherited from class java.security.SignatureSpi |
engineGetParameters, engineSign, engineVerify |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.security.MessageDigest md_
protected ECPrivateKey privateKey_
protected ECPublicKey publicKey_
protected java.security.SecureRandom secureRandom_
Constructor Detail |
public ECDSASignature() throws java.security.NoSuchAlgorithmException
Signature.getInstance("ECDSA")
method.
Method Detail |
protected java.lang.Object engineGetParameter(java.lang.String param) throws java.security.InvalidParameterException
java.security.InvalidParameterException
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyException
privateKey
- the ECDSA private key used for signing.
java.security.InvalidKeyException
- if a key encoding error occurs.protected void engineInitSign(java.security.PrivateKey privateKey, java.security.SecureRandom random) throws java.security.InvalidKeyException
privateKey
- the ECDSA private key used for signing.random
- the source for randomness.
java.security.InvalidKeyException
- if a key encoding error occurs.protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyException
publicKey
- the ECDSA public key used for the signature verification.
java.security.InvalidKeyException
- if a key encoding error occurs.protected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
java.security.InvalidAlgorithmParameterException
protected void engineSetParameter(java.lang.String param, java.lang.Object value) throws java.security.InvalidParameterException
java.security.InvalidParameterException
protected byte[] engineSign() throws java.security.SignatureException
java.security.SignatureException
protected void engineUpdate(byte b)
b
- the "new" byte.protected void engineUpdate(byte[] b, int off, int len)
b
- the byte array holding the data to be used for this update operation.off
- the offset, indicating the start position within the given byte array.len
- the number of bytes to be obtained from the given byte array, starting at the given position.protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException
sigBytes
- the encoded r and s values of the signature.
java.security.SignatureException
- if an error occurs when verifying the signature.
|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |