Class Signature


  • public class Signature
    extends java.lang.Object
    Signatures can be used to add prove to an Identity that the contained data either comes from or was checked by a specific person, institution or service
    • Constructor Summary

      Constructors 
      Constructor Description
      Signature​(java.lang.String issuerName, java.lang.String issuerIdentityID, java.lang.String dataHash)
      Creates a raw signature that is not signed yet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getVerifiableDataString()  
      boolean isValid​(java.security.PublicKey publicKey, Identity identity)
      Checks the validity of the signature
      void sign​(java.security.PrivateKey privateKey)
      Signs this Signature which makes it valid.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Signature

        public Signature​(java.lang.String issuerName,
                         java.lang.String issuerIdentityID,
                         java.lang.String dataHash)
        Creates a raw signature that is not signed yet.
        Parameters:
        issuerName - name of the issuer
        issuerIdentityID - unique identifier of the issuer
        dataHash - of the data to be signed
    • Method Detail

      • isValid

        public boolean isValid​(java.security.PublicKey publicKey,
                               Identity identity)
        Checks the validity of the signature
        Parameters:
        publicKey - of the instance that should have signed the data
        identity - the signature should belong to
        Returns:
        true if the signature is valid and belongs to the given identity
      • sign

        public void sign​(java.security.PrivateKey privateKey)
        Signs this Signature which makes it valid.
        Parameters:
        privateKey - used to sign the signature
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getVerifiableDataString

        public java.lang.String getVerifiableDataString()
        Returns:
        all the data contained in the signature that is verifiable