Skip to content

Commit

Permalink
Fix Azure algorithm to RsaOaep256 (#2270)
Browse files Browse the repository at this point in the history
* Fix Azure algorithm to RsaOaep256

* Update Azure Identity

* Revert "Update Azure Identity"

This reverts commit be6dddb.
  • Loading branch information
rayokota authored Jul 29, 2024
1 parent eb4d2c1 commit 0da59b2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public bool DoesSupport(string uri)
public async Task<byte[]> Encrypt(byte[] plaintext)
{
var client = GetCryptographyClient();
var result = await client.EncryptAsync(EncryptionAlgorithm.RsaOaep, plaintext).ConfigureAwait(false);
var result = await client.EncryptAsync(EncryptionAlgorithm.RsaOaep256, plaintext).ConfigureAwait(false);
return result.Ciphertext;
}

public async Task<byte[]> Decrypt(byte[] ciphertext)
{
var client = GetCryptographyClient();
var result = await client.DecryptAsync(EncryptionAlgorithm.RsaOaep, ciphertext).ConfigureAwait(false);
var result = await client.DecryptAsync(EncryptionAlgorithm.RsaOaep256, ciphertext).ConfigureAwait(false);
return result.Plaintext;
}

Expand All @@ -51,4 +51,4 @@ private CryptographyClient GetCryptographyClient()
return kmsClient;
}
}
}
}

0 comments on commit 0da59b2

Please sign in to comment.