Exemplo n.º 1
0
        /// <summary>
        ///     Signs the input string with the provided key
        /// </summary>
        /// <param name="ecKey">The key object to sign with</param>
        /// <param name="input">The string to be signed</param>
        /// <returns>The signature</returns>
        public static string Sign(EcKey ecKey, string input)
        {
            // return ecKey.Sign(input);
            var hash      = Sha256Hash(input);
            var hashBytes = HexToBytes(hash);
            var signature = ecKey.Sign(hashBytes);
            var bytesHex  = BytesToHex(signature);

            return(bytesHex);
        }
Exemplo n.º 2
0
        public static String sign(EcKey ecKey, String input)
        {
            String hash = sha256Hash(input);

            return(bytesToHex(ecKey.Sign(hexToBytes(hash))));
        }