Class EncryptParameters
- java.lang.Object
-
- com.azure.security.keyvault.keys.cryptography.models.EncryptParameters
-
public final class EncryptParameters extends Object
A class containing various configuration parameters that can be applied when performing encryption operations.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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[]
getAdditionalAuthenticatedData()
Get additional data to authenticate when performing encryption with an authenticated algorithm.EncryptionAlgorithm
getAlgorithm()
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[]
getPlainText()
Get the content to be encrypted.
-
-
-
Method Detail
-
createA128CbcParameters
public static EncryptParameters createA128CbcParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA128CbcParameters
public static EncryptParameters createA128CbcParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA128CbcPadParameters
public static EncryptParameters createA128CbcPadParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA128CbcPadParameters
public static EncryptParameters createA128CbcPadParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A128CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA128GcmParameters
public static EncryptParameters createA128GcmParameters(byte[] plaintext)
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
public static EncryptParameters createA192CbcParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA192CbcParameters
public static EncryptParameters createA192CbcParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA192CbcPadParameters
public static EncryptParameters createA192CbcPadParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA192CbcPadParameters
public static EncryptParameters createA192CbcPadParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A192CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA192GcmParameters
public static EncryptParameters createA192GcmParameters(byte[] plaintext)
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
public static EncryptParameters createA256CbcParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA256CbcParameters
public static EncryptParameters createA256CbcParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBC
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA256CbcPadParameters
public static EncryptParameters createA256CbcPadParameters(byte[] plaintext)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.- Returns:
- The
EncryptParameters
.
-
createA256CbcPadParameters
public static EncryptParameters createA256CbcPadParameters(byte[] plaintext, byte[] iv)
Factory method to create an instance ofEncryptParameters
with the given parameters forEncryptionAlgorithm.A256CBCPAD
.- Parameters:
plaintext
- The content to be encrypted.iv
- Initialization vector for the encryption operation.- Returns:
- The
EncryptParameters
.
-
createA256GcmParameters
public static EncryptParameters createA256GcmParameters(byte[] plaintext)
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
public static EncryptParameters createRsa15Parameters(byte[] plaintext)
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
public static EncryptParameters createRsaOaepParameters(byte[] plaintext)
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
public static EncryptParameters createRsaOaep256Parameters(byte[] plaintext)
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
public EncryptionAlgorithm 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.
-
-