コード例 #1
0
 /// <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);
コード例 #2
0
 /// <summary>
 /// Gets an instance of <see cref="IAsyncDecryptor"/> using the default credential.
 /// </summary>
 /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param>
 /// <returns>An object that can be used for decryption operations.</returns>
 public static IAsyncDecryptor GetAsyncDecryptor(this IAsyncCrypto crypto) =>
 crypto.GetAsyncDecryptor(null);
コード例 #3
0
 /// <summary>
 /// Asynchronously encrypts the specified plain text using the default credential.
 /// </summary>
 /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param>
 /// <param name="plainText">The plain text.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>The encrypted value as a byte array.</returns>
 public static Task <byte[]> EncryptAsync(this IAsyncCrypto crypto, byte[] plainText, CancellationToken cancellationToken = default(CancellationToken)) =>
 crypto.EncryptAsync(plainText, null, cancellationToken);
コード例 #4
0
 /// <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);
コード例 #5
0
 /// <summary>
 /// Asynchronously encrypts the specified plain text using the default credential.
 /// </summary>
 /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param>
 /// <param name="plainText">The plain text.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>The encrypted value as a string.</returns>
 public static Task <string> EncryptAsync(this IAsyncCrypto crypto, string plainText, CancellationToken cancellationToken = default) =>
 crypto.EncryptAsync(plainText, null, cancellationToken);
コード例 #6
0
 /// <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);
コード例 #7
0
 /// <summary>
 /// Asynchronously encrypts the specified plain text.
 /// </summary>
 /// <param name="crypto">An <see cref="IAsyncCrypto"/>.</param>
 /// <param name="plainText">The plain 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 encrypted value as a byte array.</returns>
 public static Task <byte[]> EncryptAsync(this IAsyncCrypto crypto, byte[] plainText, string credentialName = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 crypto.EncryptAsync(plainText, credentialName, cancellationToken);