Пример #1
0
        /// <summary>
        /// Recovers the account associated with the signed data.
        /// </summary>
        /// <param name="signedData">Data that was signed with.</param>
        /// <param name="signature">The signature.</param>
        /// <param name="signatureType">One of <see cref="SignatureType" />.</param>
        /// <returns>The account.</returns>
        public async Task <Account> EcRecover(string signedData, string signature, SignatureType signatureType)
        {
            string jsonResponse = await in3.SendRpc(CryptoEcRecover, new object[] { signedData, signature, signatureType?.Value });

            return(RpcHandler.From <Account>(jsonResponse));
        }
Пример #2
0
        /// <summary>
        /// Signs the data <paramref name="msg" /> with a given private key. Refer to <see cref="SignedData" /> for more information.
        /// </summary>
        /// <param name="msg">Data to be signed.</param>
        /// <param name="pk">Private key.</param>
        /// <param name="sigType">Type of signature, one of <see cref="SignatureType" />.</param>
        /// <returns>The signed data.</returns>
        public async Task <SignedData> SignData(string msg, string pk, SignatureType sigType = null)
        {
            string jsonResponse = await in3.SendRpc(CryptoSignData, new object[] { msg, pk, sigType?.Value });

            return(RpcHandler.From <SignedData>(jsonResponse));
        }