Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Rotation (Azure Key Vault) #11

Open
jhulbertpmn opened this issue Sep 17, 2024 · 1 comment
Open

Key Rotation (Azure Key Vault) #11

jhulbertpmn opened this issue Sep 17, 2024 · 1 comment
Assignees

Comments

@jhulbertpmn
Copy link

I have this library setup to work with Azure Key Vault and it is exactly what I needed. I did want to check to see how you suggest handling key rotation - if I rotate the key in the Key Vault - what are the implications for data already encrypted/how does the library handle getting the new key for future encryption and accessing data which has already been encrypted?

@harrison314 harrison314 self-assigned this Sep 17, 2024
@harrison314
Copy link
Owner

harrison314 commented Sep 17, 2024

Hello,
encryption scheme is designed to rotate asymmetric keys by re-encrypting the master key in the database. This will not lose the old data.

The ReEncrypted method is created for this, which receives the parameter fromProvider from the old key and toProvider from the encryption new key.

Then, it is possible to use both the new and old keys using the Azure Key Vault.

See: https://github.com/harrison314/Harrison314.EntityFrameworkCore.Encryption/blob/main/src/src/Harrison314.EntityFrameworkCore.Encryption/IDbContextEncryptedProvider.cs#L16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants