Class SHA256withRSA

java.lang.Object
de.christofreichardt.json.websignature.SHA256withRSA
All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable, JWSAlgorithm

public class SHA256withRSA extends Object implements 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 Type
    Method
    Description
    Returns the name of the underlying algorithm object.
    de.christofreichardt.diagnosis.AbstractTracer
     
    void
    init(Key key)
    Initialises the underlying algorithm provided by the Java platform with the given key.
    byte[]
    Requests a signature from the underlying algorithm for the delivered bytes.
    void
    update(byte[] data)
    Hands over the given bytes to the underlying algorithm provided by the Java platform.
    boolean
    verify(byte[] signature)
    Requests the validation of the delivered data agianst the given signature.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • init

      public void init(Key key) throws GeneralSecurityException
      Description copied from interface: JWSAlgorithm
      Initialises the underlying algorithm provided by the Java platform with the given key.
      Specified by:
      init in interface JWSAlgorithm
      Parameters:
      key - the cryptographic key used for signing or validating.
      Throws:
      GeneralSecurityException - if something goes wrong during the initialization.
    • update

      public void update(byte[] data) throws SignatureException
      Description copied from interface: JWSAlgorithm
      Hands over the given bytes to the underlying algorithm provided by the Java platform.
      Specified by:
      update in interface JWSAlgorithm
      Parameters:
      data - the data to be signed or to be validated.
      Throws:
      SignatureException
    • signature

      public byte[] signature() throws SignatureException
      Description copied from interface: JWSAlgorithm
      Requests a signature from the underlying algorithm for the delivered bytes.
      Specified by:
      signature in interface JWSAlgorithm
      Returns:
      the signature bytes
      Throws:
      SignatureException
    • verify

      public boolean verify(byte[] signature) throws SignatureException
      Description copied from interface: JWSAlgorithm
      Requests the validation of the delivered data agianst the given signature.
      Specified by:
      verify in interface JWSAlgorithm
      Parameters:
      signature - the signature bytes.
      Returns:
      indicates if the signature has been valid.
      Throws:
      SignatureException
    • algorithm

      public String algorithm()
      Description copied from interface: JWSAlgorithm
      Returns the name of the underlying algorithm object.
      Specified by:
      algorithm in interface JWSAlgorithm
      Returns:
      the name of the underlying algorithm object.
    • getCurrentTracer

      public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()
      Specified by:
      getCurrentTracer in interface de.christofreichardt.diagnosis.Traceable