Skip to content

Commit

Permalink
Fix Azure algorithm to RsaOaep256
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokota committed Jul 29, 2024
1 parent eb4d2c1 commit fcdc91d
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 fcdc91d

Please sign in to comment.