- java.lang.Object
-
- java.security.SignatureSpi
-
- com.ibm.crypto.hdwrCCA.provider.SHA1withECDSA
-
public final class SHA1withECDSA extends java.security.SignatureSpi
This class provides an implementation of the Service Provider Interface (SPI) for the Signature class, which is used to provide the functionality of a digital signature algorithm. Digital signatures are used for authentication and integrity assurance of digital data. The data will be hashed using the SHA1 Secure Hashing Algorithm prior to signature generation.
-
-
Constructor Summary
Constructors Constructor Description SHA1withECDSA()
Construct a signature object for the Elliptic Curve digital signature algorithm with SHA1 message digest.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.Object
engineGetParameter(java.lang.String param)
Deprecated.protected void
engineInitSign(java.security.PrivateKey privateKey)
Initializes this signature object with the specified Elliptic Curve private key for signing operations.protected void
engineInitVerify(java.security.PublicKey publicKey)
Initializes this signature object with the specified Elliptic Curve public key for verification operations.protected void
engineSetParameter(java.lang.String param, java.lang.Object value)
Deprecated.protected byte[]
engineSign()
Returns the signature bytes of all the data updated so far.protected void
engineUpdate(byte b)
Updates the data to be signed or verified using the specified byte.protected void
engineUpdate(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.protected boolean
engineVerify(byte[] sigBytes)
Verifies the passed-in signature.
-
-
-
Constructor Detail
-
SHA1withECDSA
public SHA1withECDSA() throws java.security.NoSuchAlgorithmException
Construct a signature object for the Elliptic Curve digital signature algorithm with SHA1 message digest. It must be initialized before being able to be used for signing or verifying.- Throws:
java.security.NoSuchAlgorithmException
- if the message digest algorithm can not be found
-
-
Method Detail
-
engineInitSign
protected void engineInitSign(java.security.PrivateKey privateKey) throws java.security.InvalidKeyException
Initializes this signature object with the specified Elliptic Curve private key for signing operations.- Specified by:
engineInitSign
in classjava.security.SignatureSpi
- Parameters:
privateKey
- the Elliptic Curve private key of the identity whose signature will be generated- Throws:
java.security.InvalidKeyException
- if the key is improperly encoded, parameters are missing, and so on
-
engineInitVerify
protected void engineInitVerify(java.security.PublicKey publicKey) throws java.security.InvalidKeyException
Initializes this signature object with the specified Elliptic Curve public key for verification operations.- Specified by:
engineInitVerify
in classjava.security.SignatureSpi
- Parameters:
publicKey
- the Elliptic Curve public key of the identity whose signature is going to be verified- Throws:
java.security.InvalidKeyException
- if the key is improperly encoded, parameters are missing, and so on
-
engineUpdate
protected void engineUpdate(byte b) throws java.security.SignatureException
Updates the data to be signed or verified using the specified byte.- Specified by:
engineUpdate
in classjava.security.SignatureSpi
- Parameters:
b
- the byte to use for the update- Throws:
java.security.SignatureException
- if the engine is not initialized properly
-
engineUpdate
protected void engineUpdate(byte[] b, int off, int len) throws java.security.SignatureException
Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.- Specified by:
engineUpdate
in classjava.security.SignatureSpi
- Parameters:
b
- the array of bytesoff
- the offset to start from in the array of byteslen
- the number of bytes to use, starting at offset- Throws:
java.lang.NullPointerException
- if the array of bytes is nulljava.lang.IndexOutOfBoundsException
- ifoff
andlen
values are not appropriate for the specified array of bytesjava.security.SignatureException
- if the engine is not initialized properly
-
engineSign
protected byte[] engineSign() throws java.security.SignatureException
Returns the signature bytes of all the data updated so far.- Specified by:
engineSign
in classjava.security.SignatureSpi
- Returns:
- the signature bytes of the signing operation's result
- Throws:
java.security.SignatureException
- if the engine is not initialized properly or if this signature algorithm is unable to process the input data provided
-
engineVerify
protected boolean engineVerify(byte[] sigBytes) throws java.security.SignatureException
Verifies the passed-in signature.- Specified by:
engineVerify
in classjava.security.SignatureSpi
- Parameters:
sigBytes
- the signature bytes to be verified- Returns:
- true if the signature was verified, false if not
- Throws:
java.lang.NullPointerException
- if signature bytes to be verified is nulljava.security.SignatureException
- if the engine is not initialized properly, the passed-in signature is improperly encoded or of the wrong type, if this signature algorithm is unable to process the input data provided, etc
-
engineGetParameter
@Deprecated protected java.lang.Object engineGetParameter(java.lang.String param) throws java.security.InvalidParameterException
Deprecated.Gets the value of the specified algorithm parameter. This method has no meaning for this provider.- Specified by:
engineGetParameter
in classjava.security.SignatureSpi
- Throws:
java.lang.UnsupportedOperationException
- is always thrownjava.security.InvalidParameterException
-
engineSetParameter
@Deprecated protected void engineSetParameter(java.lang.String param, java.lang.Object value) throws java.security.InvalidParameterException
Deprecated.Sets the specified algorithm parameter to the specified value. This method has no meaning for this provider.- Specified by:
engineSetParameter
in classjava.security.SignatureSpi
- Throws:
java.lang.UnsupportedOperationException
- is always thrownjava.security.InvalidParameterException
-
-