/// <summary> /// Asynchronously decrypts the specified cipher text using the default credential. /// </summary> /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param> /// <param name="cipherText">The cipher text.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>The decrypted value as a string.</returns> public static Task <string> DecryptAsync(this IAsyncCrypto crypto, string cipherText, CancellationToken cancellationToken = default) => crypto.DecryptAsync(cipherText, null, cancellationToken);
/// <summary> /// Asynchronously decrypts the specified cipher text using the default credential. /// </summary> /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param> /// <param name="cipherText">The cipher text.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>The decrypted value as a byte array.</returns> public static Task <byte[]> DecryptAsync(this IAsyncCrypto crypto, byte[] cipherText, CancellationToken cancellationToken = default(CancellationToken)) => crypto.DecryptAsync(cipherText, null, cancellationToken);
/// <summary> /// Asynchronously decrypts the specified cipher text. /// </summary> /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param> /// <param name="cipherText">The cipher text.</param> /// <param name="credentialName"> /// The name of the credential to use for this encryption operation, /// or null to use the default credential. /// </param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>The decrypted value as a byte array.</returns> public static Task <byte[]> DecryptAsync(this IAsyncCrypto crypto, byte[] cipherText, string credentialName = null, CancellationToken cancellationToken = default(CancellationToken)) => crypto.DecryptAsync(cipherText, credentialName, cancellationToken);