-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for encryption algorithms for symmetric keys (#17209)
* Added support for encryption AES encryption algorithms. * Added CryptographyOptions and ensured the initialization vector is populated before attempting to perform any local cryptography operations on symmetric keys. * Added APIs that accept CryptographyOptions to CryptographyClient. * Fixed Javadoc issues. * Fixed checkstyle issues. Added samples. * Added checkstyle exceptions. * Fixed test and spotbugs issues. * Applied PR feedback and added local tests. * Made the EncryptOptions and DecryptOptions constructor package-private, as well as their children's, and made them have factory methods for creating the former to help with discoverability. * Fixed build issues. * Changed EncryptOptions and DecryptOptions to use a factory model. * Added iv, additionalAuthenticatedDate and authenticationTag to EncryptResult. * Made `plainText` and `cipherText` all lowercase.
- Loading branch information
Showing
50 changed files
with
2,297 additions
and
403 deletions.
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
13 changes: 13 additions & 0 deletions
13
...yvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes128CbcPad.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes128CbcPad extends AesCbcPad { | ||
private static final int KEY_SIZE = 128; | ||
public static final String ALGORITHM_NAME = "A128CBCPAD"; | ||
|
||
Aes128CbcPad() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes128Gcm.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes128Gcm extends AesGcm { | ||
private static final int KEY_SIZE = 128; | ||
public static final String ALGORITHM_NAME = "A128GCM"; | ||
|
||
Aes128Gcm() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...yvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes192CbcPad.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes192CbcPad extends AesCbcPad { | ||
private static final int KEY_SIZE = 192; | ||
public static final String ALGORITHM_NAME = "A192CBCPAD"; | ||
|
||
Aes192CbcPad() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes192Gcm.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes192Gcm extends AesGcm { | ||
private static final int KEY_SIZE = 192; | ||
public static final String ALGORITHM_NAME = "A192GCM"; | ||
|
||
Aes192Gcm() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...yvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes256CbcPad.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes256CbcPad extends AesCbcPad { | ||
private static final int KEY_SIZE = 256; | ||
public static final String ALGORITHM_NAME = "A256CBCPAD"; | ||
|
||
Aes256CbcPad() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/Aes256Gcm.java
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.security.keyvault.keys.cryptography; | ||
|
||
class Aes256Gcm extends AesGcm { | ||
private static final int KEY_SIZE = 256; | ||
public static final String ALGORITHM_NAME = "A256GCM"; | ||
|
||
Aes256Gcm() { | ||
super(ALGORITHM_NAME, KEY_SIZE); | ||
} | ||
} |
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
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
Oops, something went wrong.