/// <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); }
/// <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))); }
/// <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()))); }