internal static extern int zkVerifyECDSASigFromDigestWithForeignKey(IntPtr ctx, byte[] digest, byte[] foreignPubkey, int foreignPubkeyLen, byte[] signature, int signatureLen, bool sigIsDer = false, ZkForeignPubkeyType foreignPubkeyType = ZkForeignPubkeyType.NistP256);
/// <summary> /// Verify an ECDSA signature from a digest with a foreign key. /// </summary> /// <param name="digest">The digest to verify.</param> /// <param name="signature">The signature.</param> /// <param name="foreignPubkey">The foreign key.</param> /// <param name="der">Whether the signature is DER.</param> /// <param name="pubkeyType">Type of curve to verify against.</param> /// <returns>Whether the signature is valid.</returns> public bool VerifyEcdsaSignatureFromDigest(byte[] digest, byte[] signature, byte[] foreignPubkey, bool der = false, ZkForeignPubkeyType pubkeyType = ZkForeignPubkeyType.NistP256) { var code = NativeMethods.zkVerifyECDSASigFromDigestWithForeignKey(_ref, digest, foreignPubkey, foreignPubkey.Length, signature, signature.Length, der, pubkeyType); NativeHelper.Validate(code); return(code == 1 ? true : false); }