Exemple #1
0
        /// <summary>
        /// Tries to get the verified message.
        /// </summary>
        /// <param name="signedMessage">The signed message.</param>
        /// <param name="verifiedMessage">The verified message.</param>
        /// <param name="hidden">The hidden.</param>
        /// <returns>false if signature is not correct</returns>
        public bool TryGetVerifiedMessage(WebBase64 signedMessage, out string verifiedMessage, byte[] hidden = null)
        {
            byte[] output;
            var    verified = TryGetVerifiedMessage(signedMessage.ToBytes(), out output, hidden);

            verifiedMessage = RawStringEncoding.GetString(output);
            return(verified);
        }
Exemple #2
0
 /// <summary>
 /// Gets Verified message from signed message
 /// </summary>
 /// <param name="rawData">The raw data.</param>
 /// <param name="hidden">Optional hidden data used to generate the digest signature.</param>
 /// <returns></returns>
 /// <exception cref="InvalidCryptoDataException">Data Doesn't Match Signature!</exception>
 public string VerifiedMessage(WebBase64 rawData, byte[] hidden = null)
 {
     return(RawStringEncoding.GetString(VerifiedMessage(rawData.ToBytes(), hidden)));
 }
Exemple #3
0
 /// <summary>
 /// Decrypts the specified data.
 /// </summary>
 /// <param name="data">The data.</param>
 /// <returns></returns>
 public string Decrypt(WebBase64 data)
 {
     return(RawStringEncoding.GetString(Decrypt(data.ToBytes())));
 }