Example #1
0
 /// <summary>Opens a detached Box</summary>
 /// <param name="detached">A detached object.</param>
 /// <param name="nonce">The 24 byte nonce.</param>
 /// <param name="secretKey">The recipient's secret key.</param>
 /// <param name="publicKey">The sender's public key.</param>
 /// <returns>The decrypted message.</returns>
 /// <exception cref="KeyOutOfRangeException"></exception>
 /// <exception cref="MacOutOfRangeException"></exception>
 /// <exception cref="NonceOutOfRangeException"></exception>
 /// <exception cref="CryptographicException"></exception>
 public static byte[] OpenDetached(DetachedBox detached, byte[] nonce, byte[] secretKey, byte[] publicKey)
 {
     return OpenDetached(detached.CipherText, detached.Mac, nonce, secretKey, publicKey);
 }
Example #2
0
 /// <summary>Opens a detached Secret Box</summary>
 /// <param name="detached">A detached object.</param>
 /// <param name="nonce">The 24 byte nonce.</param>
 /// <param name="key">The 32 byte nonce.</param>
 /// <returns>The decrypted text.</returns>
 /// <exception cref="KeyOutOfRangeException"></exception>
 /// <exception cref="NonceOutOfRangeException"></exception>
 /// <exception cref="MacOutOfRangeException"></exception>
 /// <exception cref="CryptographicException"></exception>
 public static byte[] OpenDetached(DetachedBox detached, byte[] nonce, byte[] key)
 {
     return(OpenDetached(detached.CipherText, detached.Mac, nonce, key));
 }
Example #3
0
 /// <summary>Opens a detached Secret Box</summary>
 /// <param name="detached">A detached object.</param>
 /// <param name="nonce">The 24 byte nonce.</param>
 /// <param name="key">The 32 byte nonce.</param>
 /// <returns>The decrypted text.</returns>
 /// <exception cref="KeyOutOfRangeException"></exception>
 /// <exception cref="NonceOutOfRangeException"></exception>
 /// <exception cref="MacOutOfRangeException"></exception>
 /// <exception cref="CryptographicException"></exception>
 public static byte[] OpenDetached(DetachedBox detached, byte[] nonce, byte[] key)
 {
     return OpenDetached(detached.CipherText, detached.Mac, nonce, key);
 }
Example #4
0
 /// <summary>Opens a detached Box</summary>
 /// <param name="detached">A detached object.</param>
 /// <param name="nonce">The 24 byte nonce.</param>
 /// <param name="secretKey">The recipient's secret key.</param>
 /// <param name="publicKey">The sender's public key.</param>
 /// <returns>The decrypted message.</returns>
 /// <exception cref="KeyOutOfRangeException"></exception>
 /// <exception cref="MacOutOfRangeException"></exception>
 /// <exception cref="NonceOutOfRangeException"></exception>
 /// <exception cref="CryptographicException"></exception>
 public static byte[] OpenDetached(DetachedBox detached, byte[] nonce, byte[] secretKey, byte[] publicKey)
 {
     return(OpenDetached(detached.CipherText, detached.Mac, nonce, secretKey, publicKey));
 }