Skip to content

[Key Vault] Add new encryption algorithms for 7.2-preview#16566

Merged
mccoyp merged 28 commits intoAzure:masterfrom
mccoyp:keys-algs-pr
Feb 10, 2021
Merged

[Key Vault] Add new encryption algorithms for 7.2-preview#16566
mccoyp merged 28 commits intoAzure:masterfrom
mccoyp:keys-algs-pr

Conversation

@mccoyp
Copy link
Member

@mccoyp mccoyp commented Feb 5, 2021

Resolves #13561.

This updates EncryptionAlgorithms and KeyWrapAlgorithms to align with .NET, and adds a "7.2-preview" API version. Support for new algorithm inputs/outputs (iv, authentication_tag, and additional_authenticated_data) has been added, and tests have been adjusted to account for a lack of local encryption capabilities with new algorithms.

@mccoyp mccoyp added KeyVault Client This issue points to a problem in the data-plane of the library. labels Feb 5, 2021
@mccoyp mccoyp added this to the [2021] February milestone Feb 5, 2021
@mccoyp mccoyp requested a review from chlowell February 5, 2021 17:14
@mccoyp mccoyp force-pushed the keys-algs-pr branch 2 times, most recently from e7d3837 to 147a92d Compare February 5, 2021 19:06
@mccoyp mccoyp requested a review from chlowell February 5, 2021 19:08
@mccoyp mccoyp requested a review from chlowell February 6, 2021 00:23
@mccoyp mccoyp requested a review from chlowell February 9, 2021 07:39
@mccoyp mccoyp marked this pull request as ready for review February 9, 2021 07:40
@mccoyp mccoyp requested a review from schaabs as a code owner February 9, 2021 07:40
@mccoyp mccoyp requested a review from chlowell February 9, 2021 23:11
key = JsonWebKey(
kty="oct-HSM",
key_ops=["encrypt", "decrypt", "wrapKey", "unwrapKey"],
k=bytes.fromhex("e27ed0c84512bbd55b6af434d237c11feba311870f80f2c2e3364260f31c82c8"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
k=bytes.fromhex("e27ed0c84512bbd55b6af434d237c11feba311870f80f2c2e3364260f31c82c8"),
k=binascii.unhexlify("e27ed0c84512bbd55b6af434d237c11feba311870f80f2c2e3364260f31c82c8"),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to push a switch to codecs.decode -- is binascii preferred?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I like it better than codecs.decode(..., "magic string") but certainly not enough to wrassle over it 💪

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the codecs approach isn't my favorite -- I'll make a note of this for when I give the tests a refresh 🤠

@mccoyp mccoyp merged commit b8aaf53 into Azure:master Feb 10, 2021
@mccoyp mccoyp deleted the keys-algs-pr branch February 10, 2021 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client This issue points to a problem in the data-plane of the library. KeyVault

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add algorithms to EncryptionAlgorithm for Key Vault

2 participants