Class SHA256withECDSA
java.lang.Object
de.christofreichardt.json.websignature.SHA256withECDSA
- All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable, JWSAlgorithm
An apapter to the underlying Signature instance provided by the Java platform which has the same name.
- Author:
- Christof Reichardt
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the underlying algorithm object.de.christofreichardt.diagnosis.AbstractTracervoidInitialises the underlying algorithm provided by the Java platform with the given key.postSigning(byte[] signature) Optional post-processing of the signature bytes, for example the signature bytes might be DER encoded and RFC 7515 or rather RFC 7518 require a different format.byte[]preValidating(byte[] signature) Optional pre-processing of the to be validated signature bytes, for example the verifying algorithm instance given by the Java runtime might require DER encoded signature bytes.byte[]Requests a signature from the underlying algorithm for the delivered bytes.voidupdate(byte[] data) Hands over the given bytes to the underlying algorithm provided by the Java platform.booleanverify(byte[] signature) Requests the validation of the delivered data agianst the given signature.
-
Method Details
-
init
Description copied from interface:JWSAlgorithmInitialises the underlying algorithm provided by the Java platform with the given key.- Specified by:
initin interfaceJWSAlgorithm- Parameters:
key- the cryptographic key used for signing or validating.- Throws:
GeneralSecurityException- if something goes wrong during the initialization.
-
update
Description copied from interface:JWSAlgorithmHands over the given bytes to the underlying algorithm provided by the Java platform.- Specified by:
updatein interfaceJWSAlgorithm- Parameters:
data- the data to be signed or to be validated.- Throws:
GeneralSecurityException- if something goes wrong during the update, e.g. the underlying algorithm hasn't been properly initialized.
-
signature
Description copied from interface:JWSAlgorithmRequests a signature from the underlying algorithm for the delivered bytes.- Specified by:
signaturein interfaceJWSAlgorithm- Returns:
- the signature bytes
- Throws:
GeneralSecurityException- if the underlying algorithm couldn't process the delivered data for various reasons.
-
verify
Description copied from interface:JWSAlgorithmRequests the validation of the delivered data agianst the given signature.- Specified by:
verifyin interfaceJWSAlgorithm- Parameters:
signature- the signature bytes.- Returns:
- indicates if the signature has been valid.
- Throws:
GeneralSecurityException- if the underlying algorithm couldn't process the delivered data for various reasons.
-
algorithm
Description copied from interface:JWSAlgorithmReturns the name of the underlying algorithm object.- Specified by:
algorithmin interfaceJWSAlgorithm- Returns:
- the name of the underlying algorithm object.
-
postSigning
Description copied from interface:JWSAlgorithmOptional post-processing of the signature bytes, for example the signature bytes might be DER encoded and RFC 7515 or rather RFC 7518 require a different format.- Specified by:
postSigningin interfaceJWSAlgorithm- Parameters:
signature- the signature bytes.- Returns:
- the optionally processed signature bytes
-
preValidating
public byte[] preValidating(byte[] signature) Description copied from interface:JWSAlgorithmOptional pre-processing of the to be validated signature bytes, for example the verifying algorithm instance given by the Java runtime might require DER encoded signature bytes.- Specified by:
preValidatingin interfaceJWSAlgorithm- Parameters:
signature- the signature bytes.- Returns:
- the optionally processed signature bytes
-
getCurrentTracer
public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()- Specified by:
getCurrentTracerin interfacede.christofreichardt.diagnosis.Traceable
-