Class EncryptParameters
java.lang.Object
com.azure.security.keyvault.keys.cryptography.models.EncryptParameters
A class containing various configuration parameters that can be applied when performing encryption operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EncryptParameters
createA128CbcPadParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.static EncryptParameters
createA128CbcPadParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.static EncryptParameters
createA128CbcParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.static EncryptParameters
createA128CbcParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.static EncryptParameters
createA128GcmParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128GCM
.static EncryptParameters
createA128GcmParameters
(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128GCM
.static EncryptParameters
createA192CbcPadParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.static EncryptParameters
createA192CbcPadParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.static EncryptParameters
createA192CbcParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.static EncryptParameters
createA192CbcParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.static EncryptParameters
createA192GcmParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192GCM
.static EncryptParameters
createA192GcmParameters
(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192GCM
.static EncryptParameters
createA256CbcPadParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.static EncryptParameters
createA256CbcPadParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.static EncryptParameters
createA256CbcParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.static EncryptParameters
createA256CbcParameters
(byte[] plaintext, byte[] iv) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.static EncryptParameters
createA256GcmParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256GCM
.static EncryptParameters
createA256GcmParameters
(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256GCM
.static EncryptParameters
createRsa15Parameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA1_5
.static EncryptParameters
createRsaOaep256Parameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA_OAEP_256
.static EncryptParameters
createRsaOaepParameters
(byte[] plaintext) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA_OAEP
.byte[]
Get additional data to authenticate when performing encryption with an authenticated algorithm.The algorithm to be used for encryption.byte[]
getIv()
Get the initialization vector to be used in the encryption operation using a symmetric algorithm.byte[]
Get the content to be encrypted.
-
Method Details
-
createA128CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA128CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA128CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA128CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA128GcmParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128GCM
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA128GcmParameters
public static EncryptParameters createA128GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128GCM
.- Parameters:
plaintext
- The content to be encrypted.additionalAuthenticatedData
- Additional data to authenticate when using authenticated crypto algorithms.- Returns:
- The
EncryptParameters
.
-
createA192CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA192CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA192CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA192CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA192GcmParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192GCM
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA192GcmParameters
public static EncryptParameters createA192GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192GCM
.- Parameters:
plaintext
- The content to be encrypted.additionalAuthenticatedData
- Additional data to authenticate when using authenticated crypto algorithms.- Returns:
- The
EncryptParameters
.
-
createA256CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA256CbcParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA256CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA256CbcPadParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Optional initialization vector for the encryption operation. If you pass your own IV, make sure you use a cryptographically random, non-repeating IV. Ifnull
, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations,SecureRandom
will be used instead.- Returns:
- The
EncryptParameters
.
-
createA256GcmParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256GCM
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA256GcmParameters
public static EncryptParameters createA256GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData) Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256GCM
.- Parameters:
plaintext
- The content to be encrypted.additionalAuthenticatedData
- Additional data to authenticate when using authenticated crypto algorithms.- Returns:
- The
EncryptParameters
.
-
createRsa15Parameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA1_5
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createRsaOaepParameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA_OAEP
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createRsaOaep256Parameters
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.RSA_OAEP_256
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
getAlgorithm
The algorithm to be used for encryption.- Returns:
- The algorithm to be used for encryption.
-
getPlainText
public byte[] getPlainText()Get the content to be encrypted.- Returns:
- The content to be encrypted.
-
getIv
public byte[] getIv()Get the initialization vector to be used in the encryption operation using a symmetric algorithm.- Returns:
- The initialization vector.
-
getAdditionalAuthenticatedData
public byte[] getAdditionalAuthenticatedData()Get additional data to authenticate when performing encryption with an authenticated algorithm.- Returns:
- The additional authenticated data.
-