コード例 #1
0
        public static bool VerifyAuthorizerSignature(string message, string publicKey, string signature)
        {
            if (string.IsNullOrWhiteSpace(message) || !ValidatePublicKey(publicKey) || string.IsNullOrWhiteSpace(signature))
            {
                return(false);
            }
            var publicKeyBytes = Base58Encoding.DecodePublicKey(publicKey);

            return(VerifySignature(message, publicKeyBytes, signature));
        }
コード例 #2
0
 // It can validate either public or private key - thanks to the checksum
 public static bool ValidatePublicKey(string PublicKey)
 {
     try
     {
         Base58Encoding.DecodePublicKey(PublicKey);
         return(true);
     }
     catch
     {
         return(false);
     }
 }