Class Transformation


  • public class Transformation
    extends java.lang.Object
    Transformation algorithm, mode and padding, in the format "Algorithm/Mode/Padding", for example "AES/CBC/NoPadding".
    Since:
    1.2.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Transformation​(java.lang.String algorithm, java.lang.String mode, java.lang.String padding)
      Constructs a new instance.
      private Transformation​(java.lang.String algorithm, java.lang.String mode, Padding padding)
      Constructs a new instance.
    • Field Detail

      • algorithm

        private final java.lang.String algorithm
      • mode

        private final java.lang.String mode
      • padding

        private final Padding padding
    • Constructor Detail

      • Transformation

        private Transformation​(java.lang.String algorithm,
                               java.lang.String mode,
                               Padding padding)
        Constructs a new instance.
        Parameters:
        algorithm - the algorithm name
        mode - the mode name
        padding - the padding name
      • Transformation

        private Transformation​(java.lang.String algorithm,
                               java.lang.String mode,
                               java.lang.String padding)
                        throws javax.crypto.NoSuchPaddingException
        Constructs a new instance.
        Parameters:
        algorithm - the algorithm name
        mode - the mode name
        padding - the padding name
        Throws:
        javax.crypto.NoSuchPaddingException - Thrown when the padding is unsupported.
    • Method Detail

      • parse

        public static Transformation parse​(java.lang.String transformation)
                                    throws java.security.NoSuchAlgorithmException,
                                           javax.crypto.NoSuchPaddingException
        Parses a transformation.
        Parameters:
        transformation - current transformation
        Returns:
        the Transformation
        Throws:
        java.security.NoSuchAlgorithmException - if the algorithm is not supported
        javax.crypto.NoSuchPaddingException - Thrown when the padding is unsupported.
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Gets the algorithm.
        Returns:
        the algorithm.
      • getMode

        public java.lang.String getMode()
        Gets the mode.
        Returns:
        the mode.
      • getPadding

        public Padding getPadding()
        Gets the padding.
        Returns:
        the padding.