-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Vault Keys] Add new algorithms #11380
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d3f9360
[Key Vault Keys] Add new algorithms
sadasant e363ffd
seems like this was necessary. Not sure how I didnt catch it before
sadasant 8e6d77b
Renamed aad as additionalAuthenticatedData
sadasant f296714
formatting
sadasant d437ff9
this seems better
sadasant 359a578
API changes after recent feedback
sadasant 9fb0ab1
lint fix
sadasant e155811
swagger property rename WIP
sadasant 872e597
generated changes
sadasant 57e2019
removed console.log
sadasant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ import { | |
GetKeyOptions, | ||
KeyVaultKey, | ||
LATEST_API_VERSION, | ||
CryptographyOptions, | ||
CryptographyClientOptions, | ||
KeyOperation | ||
} from "./keysModels"; | ||
|
@@ -46,7 +45,13 @@ import { | |
SignatureAlgorithm, | ||
SignResult, | ||
VerifyResult, | ||
EncryptResult | ||
EncryptResult, | ||
EncryptOptions, | ||
DecryptOptions, | ||
WrapKeyOptions, | ||
UnwrapKeyOptions, | ||
SignOptions, | ||
VerifyOptions | ||
} from "./cryptographyClientModels"; | ||
import { KeyBundle } from "./generated/models"; | ||
import { parseKeyVaultKeyId } from "./identifier"; | ||
|
@@ -737,33 +742,3 @@ export class CryptographyClient { | |
} | ||
} | ||
} | ||
|
||
/** | ||
* Options for {@link encrypt}. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved these from this file to the models file. It made more sense to me. |
||
*/ | ||
export interface EncryptOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link decrypt}. | ||
*/ | ||
export interface DecryptOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link sign}. | ||
*/ | ||
export interface SignOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link verify}. | ||
*/ | ||
export interface VerifyOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link wrapKey}. | ||
*/ | ||
export interface WrapKeyOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link unwrapKey}. | ||
*/ | ||
export interface UnwrapKeyOptions extends CryptographyOptions {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { CryptographyOptions } from "./keysModels"; | ||
|
||
/** | ||
* Defines values for SignatureAlgorithm. | ||
* @readonly | ||
|
@@ -20,11 +22,26 @@ export type SignatureAlgorithm = | |
|
||
/** | ||
* Defines values for EncryptionAlgorithm. | ||
* Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' | ||
* Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5', 'A128GCM', 'A192GCM', 'A256GCM', 'A128KW', 'A192KW', 'A256KW', 'A128CBC', 'A192CBC', 'A256CBC', 'A128CBCPAD', 'A192CBCPAD', 'A256CBCPAD' | ||
* @readonly | ||
* @enum {string} | ||
*/ | ||
export type EncryptionAlgorithm = "RSA-OAEP" | "RSA-OAEP-256" | "RSA1_5"; | ||
export type EncryptionAlgorithm = | ||
| "RSA-OAEP" | ||
| "RSA-OAEP-256" | ||
| "RSA1_5" | ||
| "A128GCM" | ||
| "A192GCM" | ||
| "A256GCM" | ||
| "A128KW" | ||
| "A192KW" | ||
| "A256KW" | ||
| "A128CBC" | ||
| "A192CBC" | ||
| "A256CBC" | ||
| "A128CBCPAD" | ||
| "A192CBCPAD" | ||
| "A256CBCPAD"; | ||
|
||
/** | ||
* Defines values for KeyCurveName. | ||
|
@@ -137,3 +154,52 @@ export interface VerifyResult { | |
*/ | ||
keyID?: string; | ||
} | ||
|
||
/** | ||
* Common optional properties for encrypt, decrypt, wrap and unwrap. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved these from this file to the models file. It made more sense to me. |
||
*/ | ||
export interface KeyOperationsOptions extends CryptographyOptions { | ||
/** | ||
* Initialization vector for symmetric algorithms. | ||
*/ | ||
iv?: Uint8Array; | ||
/** | ||
* Additional data to authenticate but not encrypt/decrypt when using authenticated crypto | ||
* algorithms. | ||
*/ | ||
aad?: Uint8Array; | ||
/** | ||
* The tag to authenticate when performing decryption with an authenticated algorithm. | ||
*/ | ||
tag?: Uint8Array; | ||
} | ||
|
||
/** | ||
* Options for {@link encrypt}. | ||
*/ | ||
export interface EncryptOptions extends KeyOperationsOptions {} | ||
|
||
/** | ||
* Options for {@link decrypt}. | ||
*/ | ||
export interface DecryptOptions extends KeyOperationsOptions {} | ||
|
||
/** | ||
* Options for {@link sign}. | ||
*/ | ||
export interface SignOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link verify}. | ||
*/ | ||
export interface VerifyOptions extends CryptographyOptions {} | ||
|
||
/** | ||
* Options for {@link wrapKey}. | ||
*/ | ||
export interface WrapKeyOptions extends KeyOperationsOptions {} | ||
|
||
/** | ||
* Options for {@link unwrapKey}. | ||
*/ | ||
export interface UnwrapKeyOptions extends KeyOperationsOptions {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
additionalAuthenticatedData
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additionalAuthenticatedData
is way better! Thank you!