Class ECDSASignature

java.lang.Object
org.fisco.bcos.sdk.crypto.signature.ECDSASignature
All Implemented Interfaces:
Signature

public class ECDSASignature
extends java.lang.Object
implements Signature
  • Constructor Summary

    Constructors 
    Constructor Description
    ECDSASignature()  
  • Method Summary

    Modifier and Type Method Description
    SignatureResult sign​(byte[] message, CryptoKeyPair keyPair)
    sign message with the given keyPair
    SignatureResult sign​(java.lang.String message, CryptoKeyPair keyPair)  
    java.lang.String signWithStringSignature​(java.lang.String message, CryptoKeyPair keyPair)  
    boolean verify​(java.lang.String publicKey, byte[] message, byte[] signature)  
    boolean verify​(java.lang.String publicKey, java.lang.String message, java.lang.String signature)
    verify signature

    Methods inherited from class java.lang.Object

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

  • Method Details

    • sign

      public SignatureResult sign​(java.lang.String message, CryptoKeyPair keyPair)
      Specified by:
      sign in interface Signature
    • sign

      public SignatureResult sign​(byte[] message, CryptoKeyPair keyPair)
      Description copied from interface: Signature
      sign message with the given keyPair
      Specified by:
      sign in interface Signature
      Parameters:
      message - the message to be signed, must be hash value
      keyPair - the keyPair used to generate the signature
      Returns:
      the signature result
    • signWithStringSignature

      public java.lang.String signWithStringSignature​(java.lang.String message, CryptoKeyPair keyPair)
      Specified by:
      signWithStringSignature in interface Signature
    • verify

      public boolean verify​(java.lang.String publicKey, java.lang.String message, java.lang.String signature)
      Description copied from interface: Signature
      verify signature
      Specified by:
      verify in interface Signature
      Parameters:
      publicKey - the publickey
      message - the message, must be hash value
      signature - the signature to be verified
      Returns:
      true/false
    • verify

      public boolean verify​(java.lang.String publicKey, byte[] message, byte[] signature)
      Specified by:
      verify in interface Signature