EcdsaWithNoneSignature
insteadpublic final class EntrustRawECDSA extends java.security.Signature implements ExtendedSignature
This class expects its input to be already hashed with SHA-1. It is not expected that the Raw DSA algorithm will be heavily used by application developers; it is mainly for internal purposes.
This class supports the usual private keys of class
ECDSAPrivateKey, as well as Entrust confined EC private keys of
class ConfinedPrivateKey, which might be retrieved by invoking
User.getSigningKey(), for example.
Use the "Raw" ECDSA signature like any other signature algorithm, but supply the hashed data to the update() methods instead of the original data to be signed. You can call all of the update methods in any combination, but when you call sign() or verify() exactly 20 bytes must have been passed during the updates. This is necessary because ECDSA was specifically designed for the 160 bit hashes of SHA-1.
Signature.getInstance("RawECDSA") to create a Raw ECDSA
Signature object.Signature| Constructor and Description |
|---|
EntrustRawECDSA()
Deprecated.
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
engineGetParameter(java.lang.String param)
Deprecated.
Always throws an exception for security reasons.
|
protected void |
engineInitSign(java.security.PrivateKey privateKey)
Deprecated.
Initializes this signature object with the specified private key for
signing operations.
|
protected void |
engineInitVerify(java.security.PublicKey publicKey)
Deprecated.
Initializes this signature object with the specified public key for
verification operations.
|
protected void |
engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
Deprecated.
Sets the specified algorithm parameter to the specified value.
|
protected void |
engineSetParameter(java.lang.String param,
java.lang.Object value)
Deprecated.
Sets the specified algorithm parameter to the specified value.
|
protected byte[] |
engineSign()
Deprecated.
Returns the signature byte array containing all of the updated data.
|
protected void |
engineUpdate(byte b)
Deprecated.
SPI: Updates the data to be signed or verified with the
specified byte.
|
protected void |
engineUpdate(byte[] b,
int off,
int len)
Deprecated.
SPI: Updates the data to be signed or verified with the
specified number of hashed bytes, beginning at the specified offset
within the given byte array.
|
protected boolean |
engineVerify(byte[] sigBytes)
Deprecated.
Verifies the signature.
|
byte[] |
getDigest()
Deprecated.
Returns the digest that was calculated during signature generation or
verification.
|
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verifypublic EntrustRawECDSA()
Creates a new EntrustRawECDSA signature object.
Applications use Signature.getInstance("RawECDSA"); for
creating a raw ECDSA Signature object.
Signature.getInstance(java.lang.String)protected void engineInitVerify(java.security.PublicKey publicKey)
throws java.security.InvalidKeyException
engineInitVerify in class java.security.SignatureSpipublicKey - the public key of the identity whose signature is to be
verifiedjava.security.InvalidKeyException - if the key type is wrong (if it is not an
ECDSAPublicKey object, for example)protected void engineInitSign(java.security.PrivateKey privateKey)
throws java.security.InvalidKeyException
engineInitSign in class java.security.SignatureSpiprivateKey - the private key of the identity whose signature is to be
generatedjava.security.InvalidKeyException - if the key is not a supported EC private key instanceprotected void engineUpdate(byte b)
throws java.security.SignatureException
engineUpdate in class java.security.SignatureSpib - the hash byte to be used for updating datajava.security.SignatureException - if the engine has not been properly initializedprotected void engineUpdate(byte[] b,
int off,
int len)
throws java.security.SignatureException
engineUpdate in class java.security.SignatureSpib - the byte array holding the hashed data to be used for this
update operationoff - the offset, indicating the start position within the given
byte arraylen - the number of bytes to be obtained from the given byte array,
starting at the given positionjava.security.SignatureException - if the engine has not been properly initializedprotected byte[] engineSign()
throws java.security.SignatureException
The format of the signature is a DER encoded ASN1 structure as defined in X9.62 (a SEQUENCE consisting of two INTEGER components).
engineSign in class java.security.SignatureSpijava.security.SignatureException - if the engine is not properly initializedprotected boolean engineVerify(byte[] sigBytes)
throws java.security.SignatureException
engineVerify in class java.security.SignatureSpisigBytes - the signature byte array to be verifiedtrue if the signature is valid
false otherwisejava.security.SignatureException - if the engine is not properly initialized, or if the
signature is improperly encoded or of the wrong typeprotected void engineSetParameter(java.lang.String param,
java.lang.Object value)
throws java.security.InvalidParameterException
engineSetParameter in class java.security.SignatureSpijava.security.InvalidParameterException - always thrownprotected void engineSetParameter(java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
engineSetParameter in class java.security.SignatureSpijava.security.InvalidParameterException - always thrownjava.security.InvalidAlgorithmParameterExceptionprotected java.lang.Object engineGetParameter(java.lang.String param)
throws java.security.InvalidParameterException
engineGetParameter in class java.security.SignatureSpiparam - the name of the parameter whose value is to be obtainedjava.security.InvalidParameterExceptionSignature.getParameter(java.lang.String),
Signature.setParameter(java.lang.String, java.lang.Object)public byte[] getDigest()
ExtendedSignature
During both a signature generation and verification operation a digest is
calculated over the message; this digest is then used as an input to the
signature generation or verification process. This API simply provides
access to the digest once it has been calculated; it always returns the
digest from the last operation. If a signature generation or verification
operation has not yet been executed or is in the process of being
executed, null is returned.
To ensure a non-null result, this method should only be called after
Signature.sign() or Signature.verify() has
called.
getDigest in interface ExtendedSignature