func Verify(data []byte, signature []byte, publicKey *PublicKey) error {
	sig := &ECDSASignature{}
	_, err := asn1.Unmarshal(signature, sig)
	if err != nil {
		return err
	}
	h := sha256.Sum256(data)
	valid := ecdsa.Verify(
		(*ecdsa.PublicKey)(publicKey),
		h[:],
		sig.R,
		sig.S,
	)
	if !valid {
		return errors.New("signature validation failed")
	}
	// signature is valid
	return nil
}
// Verify validates decrypted message against the given public key.
// On success, returns nil, on failure returns a relevant error.
Verify validates decrypted message against the given public key.
On success, returns nil, on failure returns a relevant error.
// Verify validates decrypted message against the given public key . // On success returns nil on failure returns a relevant error .
func Verify(data []byte, signature []byte, publicKey *PublicKey) error {
	sig := &ECDSASignature{}
	_, err := asn1.Unmarshal(signature, sig)
	if err != nil {
		return err
	}
	h := sha256.Sum256(data)
	valid := ecdsa.Verify(
		(*ecdsa.PublicKey)(publicKey),
		h[:],
		sig.R,
		sig.S,
	)
	if !valid {
		return errors.New("signature validation failed")
	}
	return nil
}
func Verify ( data [ ] byte , signature [ ] byte , publicKey * PublicKey ) error { sig := & ECDSASignature { } _ , err := asn1 . Unmarshal ( signature , sig ) if err != nil { return err } h := sha256 . Sum256 ( data ) valid := ecdsa . Verify ( ( * ecdsa . PublicKey ) ( publicKey ) , h [ : ] , sig . R , sig . S , ) if ! valid { return errors . New ( " " ) } return nil }
Verify validates decrypted message against the given public key.
Verify validates decrypted message against the given public key .
// signature is valid