Enum PassphraseEncryptionCipherType

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AES_128
      Cipher settings that use a 128-bit AES cipher.
      AES_256
      Cipher settings that use a 256-bit AES cipher.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PassphraseEncryptionCipherType forName​(java.lang.String name)
      Retrieves the cipher type value for the provided name.
      java.lang.String getCipherTransformation()
      Retrieves the cipher transformation that will be used for the encryption.
      int getInitializationVectorLengthBytes()
      Retrieves the length (in bytes) to use for the initialization vector when generating the cipher.
      java.lang.String getKeyFactoryAlgorithm()
      Retrieves the name of the algorithm that will be used to generate the encryption key from the passphrase.
      int getKeyFactoryIterationCount()
      Retrieves the iteration count that will be used when generating the encryption key from the passphrase.
      int getKeyFactorySaltLengthBytes()
      Retrieves the length (in bytes) to use for the salt when generating the encryption key from the passphrase.
      int getKeyLengthBits()
      Retrieves the length (in bits) for the encryption key to generate.
      java.lang.String getMacAlgorithm()
      Retrieves the name of the algorithm that will be used to generate a MAC of the encryption header contents.
      static PassphraseEncryptionCipherType getStrongestAvailableCipherType()
      Retrieves the cipher type value that corresponds to the strongest supported level of protection that is available in the underlying JVM.
      java.lang.String toString()
      Retrieves a string representation of this cipher type value.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this cipher type value to the provided buffer.
      static PassphraseEncryptionCipherType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PassphraseEncryptionCipherType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static PassphraseEncryptionCipherType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PassphraseEncryptionCipherType c : PassphraseEncryptionCipherType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PassphraseEncryptionCipherType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getCipherTransformation

        @NotNull
        public java.lang.String getCipherTransformation()
        Retrieves the cipher transformation that will be used for the encryption.
        Returns:
        The cipher transformation that will be used for the encryption.
      • getKeyLengthBits

        public int getKeyLengthBits()
        Retrieves the length (in bits) for the encryption key to generate.
        Returns:
        The length (in bits) for the encryption key to generate.
      • getKeyFactoryAlgorithm

        @NotNull
        public java.lang.String getKeyFactoryAlgorithm()
        Retrieves the name of the algorithm that will be used to generate the encryption key from the passphrase.
        Returns:
        The name of the algorithm that will be used to generate the encryption key from the passphrase.
      • getKeyFactoryIterationCount

        public int getKeyFactoryIterationCount()
        Retrieves the iteration count that will be used when generating the encryption key from the passphrase.
        Returns:
        The iteration count that will be used when generating the encryption key from the passphrase.
      • getKeyFactorySaltLengthBytes

        public int getKeyFactorySaltLengthBytes()
        Retrieves the length (in bytes) to use for the salt when generating the encryption key from the passphrase.
        Returns:
        The length (in bytes) to use for the salt when generating the encryption key from the passphrase.
      • getInitializationVectorLengthBytes

        public int getInitializationVectorLengthBytes()
        Retrieves the length (in bytes) to use for the initialization vector when generating the cipher.
        Returns:
        The length (in bytes) to use for the initialization vector when generating the cipher.
      • getMacAlgorithm

        @NotNull
        public java.lang.String getMacAlgorithm()
        Retrieves the name of the algorithm that will be used to generate a MAC of the encryption header contents.
        Returns:
        The name of the algorithm that will be used to generate a MAC of the encryption header contents.
      • forName

        @Nullable
        public static PassphraseEncryptionCipherType forName​(@NotNull
                                                             java.lang.String name)
        Retrieves the cipher type value for the provided name.
        Parameters:
        name - The name of the cipher type value to retrieve.
        Returns:
        The cipher type object for the given name, or null if the provided name does not map to any cipher type value.
      • getStrongestAvailableCipherType

        @NotNull
        public static PassphraseEncryptionCipherType getStrongestAvailableCipherType()
        Retrieves the cipher type value that corresponds to the strongest supported level of protection that is available in the underlying JVM.
        Returns:
        The cipher type value that corresponds to the strongest supported level of protection in the underlying JVM.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this cipher type value.
        Overrides:
        toString in class java.lang.Enum<PassphraseEncryptionCipherType>
        Returns:
        A string representation of this cipher type value.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of this cipher type value to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended.