EncryptParameters Class

  • java.lang.Object
    • com.azure.security.keyvault.keys.cryptography.models.EncryptParameters

public final class EncryptParameters

A class containing various configuration parameters that can be applied when performing encryption operations.

Method Summary

Modifier and Type Method and Description
static EncryptParameters createA128CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBCPAD.

static EncryptParameters createA128CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBCPAD.

static EncryptParameters createA128CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBC.

static EncryptParameters createA128CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBC.

static EncryptParameters createA128GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128GCM.

static EncryptParameters createA128GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A128GCM.

static EncryptParameters createA192CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBCPAD.

static EncryptParameters createA192CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBCPAD.

static EncryptParameters createA192CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBC.

static EncryptParameters createA192CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBC.

static EncryptParameters createA192GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192GCM.

static EncryptParameters createA192GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A192GCM.

static EncryptParameters createA256CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBCPAD.

static EncryptParameters createA256CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBCPAD.

static EncryptParameters createA256CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBC.

static EncryptParameters createA256CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBC.

static EncryptParameters createA256GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256GCM.

static EncryptParameters createA256GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A256GCM.

static EncryptParameters createRsa15Parameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for RSA1_5.

static EncryptParameters createRsaOaep256Parameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for RSA_OAEP_256.

static EncryptParameters createRsaOaepParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for 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.

Methods inherited from java.lang.Object

Method Details

createA128CbcPadParameters

public static EncryptParameters createA128CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBCPAD.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA128CbcPadParameters

public static EncryptParameters createA128CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA128CbcParameters

public static EncryptParameters createA128CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128CBC.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA128CbcParameters

public static EncryptParameters createA128CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA128GcmParameters

public static EncryptParameters createA128GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A128GCM.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA128GcmParameters

public static EncryptParameters createA128GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A128GCM.

Parameters:

plaintext - The content to be encrypted.
additionalAuthenticatedData - Additional data to authenticate when using authenticated crypto algorithms.

Returns:

createA192CbcPadParameters

public static EncryptParameters createA192CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBCPAD.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA192CbcPadParameters

public static EncryptParameters createA192CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA192CbcParameters

public static EncryptParameters createA192CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192CBC.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA192CbcParameters

public static EncryptParameters createA192CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA192GcmParameters

public static EncryptParameters createA192GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A192GCM.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA192GcmParameters

public static EncryptParameters createA192GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A192GCM.

Parameters:

plaintext - The content to be encrypted.
additionalAuthenticatedData - Additional data to authenticate when using authenticated crypto algorithms.

Returns:

createA256CbcPadParameters

public static EncryptParameters createA256CbcPadParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBCPAD.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA256CbcPadParameters

public static EncryptParameters createA256CbcPadParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA256CbcParameters

public static EncryptParameters createA256CbcParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256CBC.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA256CbcParameters

public static EncryptParameters createA256CbcParameters(byte[] plaintext, byte[] iv)

Factory method to create an instance of EncryptParameters with the given parameters for 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. If null, a cryptographically random IV will be generated by Key Vault for service-side operations. For client-side operations, SecureRandom will be used instead.

Returns:

createA256GcmParameters

public static EncryptParameters createA256GcmParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for A256GCM.

Parameters:

plaintext - The content to be encrypted.

Returns:

createA256GcmParameters

public static EncryptParameters createA256GcmParameters(byte[] plaintext, byte[] additionalAuthenticatedData)

Factory method to create an instance of EncryptParameters with the given parameters for A256GCM.

Parameters:

plaintext - The content to be encrypted.
additionalAuthenticatedData - Additional data to authenticate when using authenticated crypto algorithms.

Returns:

createRsa15Parameters

public static EncryptParameters createRsa15Parameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for RSA1_5.

Parameters:

plaintext - The content to be encrypted.

Returns:

createRsaOaep256Parameters

public static EncryptParameters createRsaOaep256Parameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for RSA_OAEP_256.

Parameters:

plaintext - The content to be encrypted.

Returns:

createRsaOaepParameters

public static EncryptParameters createRsaOaepParameters(byte[] plaintext)

Factory method to create an instance of EncryptParameters with the given parameters for RSA_OAEP.

Parameters:

plaintext - The content to be encrypted.

Returns:

getAdditionalAuthenticatedData

public byte[] getAdditionalAuthenticatedData()

Get additional data to authenticate when performing encryption with an authenticated algorithm.

Returns:

The additional authenticated data.

getAlgorithm

public EncryptionAlgorithm getAlgorithm()

The algorithm to be used for encryption.

Returns:

The algorithm to be used for encryption.

getIv

public byte[] getIv()

Get the initialization vector to be used in the encryption operation using a symmetric algorithm.

Returns:

The initialization vector.

getPlainText

public byte[] getPlainText()

Get the content to be encrypted.

Returns:

The content to be encrypted.

Applies to