src/main/java/com/hedera/hashgraph/identity/hcs/MessageEnvelope.java
/**
   * Verifies the signature of the envelope against the public key of it's signer.
   *
   * @param publicKeyProvider Provider of a public key of this envelope signer.
   * @return True if the message is valid, false otherwise.
   */
Verifies the signature of the envelope against the public key of it's signer.
@param publicKeyProvider Provider of a public key of this envelope signer.
@return True if the message is valid, false otherwise.
Verifies the signature of the envelope against the public key of it ' s signer . @param publicKeyProvider Provider of a public key of this envelope signer . @return True if the message is valid false otherwise .
public boolean isSignatureValid(final Function<MessageEnvelope<T>, PublicKey> publicKeyProvider) {
    if (signature == null || messageJson == null) {
      return false;
    }
    PublicKey publicKey = publicKeyProvider.apply(this);
    if (publicKey == null) {
      return false;
    }
    byte[] signatureToVerify = Base64.getDecoder().decode(signature.getBytes(StandardCharsets.UTF_8));
    byte[] messageBytes = messageJson.getBytes(StandardCharsets.UTF_8);
    return Ed25519.verify(signatureToVerify, 0, publicKey.toBytes(), 0, messageBytes, 0, messageBytes.length);
  }
public boolean isSignatureValid ( final Function < MessageEnvelope < T > , PublicKey > publicKeyProvider ) { if ( signature == null || messageJson == null ) { return false ; } PublicKey publicKey = publicKeyProvider . apply ( this ) ; if ( publicKey == null ) { return false ; } byte [ ] signatureToVerify = Base64 . getDecoder ( ) . decode ( signature . getBytes ( StandardCharsets . UTF_8 ) ) ; byte [ ] messageBytes = messageJson . getBytes ( StandardCharsets . UTF_8 ) ; return Ed25519 . verify ( signatureToVerify , 0 , publicKey . toBytes ( ) , 0 , messageBytes , 0 , messageBytes . length ) ; }
Verifies the signature of the envelope against the public key of it's signer.
Verifies the signature of the envelope against the public key of it ' s signer .