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 Details

    • createA128CbcParameters

      public static EncryptParameters createA128CbcParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA128CbcPadParameters

      public static EncryptParameters createA128CbcPadParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA128GcmParameters

      public static EncryptParameters createA128GcmParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA192CbcPadParameters

      public static EncryptParameters createA192CbcPadParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA192GcmParameters

      public static EncryptParameters createA192GcmParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA256CbcPadParameters

      public static EncryptParameters createA256CbcPadParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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:
      The EncryptParameters.
    • createA256GcmParameters

      public static EncryptParameters createA256GcmParameters(byte[] plaintext)
      Factory method to create an instance of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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 of EncryptParameters with the given parameters for EncryptionAlgorithm.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.