- java.lang.Object
-
- java.security.SignatureSpi
-
- com.ibm.crypto.hdwrCCA.provider.SHA2withECDSA
-
public final class SHA2withECDSA extends java.security.SignatureSpiThis 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 SHA256 Secure Hashing Algorithm prior to signature generation.
-
-
Constructor Summary
Constructors Constructor Description SHA2withECDSA()Construct a signature object for the Elliptic Curve digital signature algorithm with SHA2 message digest.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.ObjectengineGetParameter(java.lang.String param)Deprecated.protected voidengineInitSign(java.security.PrivateKey privateKey)Initializes this signature object with the specified Elliptic Curve private key for signing operations.protected voidengineInitVerify(java.security.PublicKey publicKey)Initializes this signature object with the specified Elliptic Curve public key for verification operations.protected voidengineSetParameter(java.lang.String param, java.lang.Object value)Deprecated.protected byte[]engineSign()Returns the signature bytes of all the data updated so far.protected voidengineUpdate(byte b)Updates the data to be signed or verified using the specified byte.protected voidengineUpdate(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 booleanengineVerify(byte[] sigBytes)Verifies the passed-in signature.
-
-
-
Constructor Detail
-
SHA2withECDSA
public SHA2withECDSA() throws java.security.NoSuchAlgorithmExceptionConstruct a signature object for the Elliptic Curve digital signature algorithm with SHA2 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.InvalidKeyExceptionInitializes this signature object with the specified Elliptic Curve private key for signing operations.- Specified by:
engineInitSignin 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.InvalidKeyExceptionInitializes this signature object with the specified Elliptic Curve public key for verification operations.- Specified by:
engineInitVerifyin 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.SignatureExceptionUpdates the data to be signed or verified using the specified byte.- Specified by:
engineUpdatein 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.SignatureExceptionUpdates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.- Specified by:
engineUpdatein 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- ifoffandlenvalues 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.SignatureExceptionReturns the signature bytes of all the data updated so far.- Specified by:
engineSignin 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.SignatureExceptionVerifies the passed-in signature.- Specified by:
engineVerifyin 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.InvalidParameterExceptionDeprecated.Gets the value of the specified algorithm parameter. This method has no meaning for this provider.- Specified by:
engineGetParameterin 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.InvalidParameterExceptionDeprecated.Sets the specified algorithm parameter to the specified value. This method has no meaning for this provider.- Specified by:
engineSetParameterin classjava.security.SignatureSpi- Throws:
java.lang.UnsupportedOperationException- is always thrownjava.security.InvalidParameterException
-
-