Class AESParameters


  • public final class AESParameters
    extends java.security.AlgorithmParametersSpi
    This class implements the parameters (IV) used with the AES algorithm in feedback-mode. IV is defined in the standards as follows:

     IV ::= OCTET STRING  -- 16 octets
     

    This documentation describes a Service Provider Interface. It is provided for implementation insight only. This class is not intended to be called directly by application developers. Please consult the 'Java Cryptography Architecture Standard' for details on how to use this interface through a public standard class.

    Note:
    Certain operations may require specific hardware or software, or specific key types. See the rest of this document and the z/OS Unique Considerations Hardware Crypto Reference Guide for more details. Unsupported operations and/or combinations may result in a RuntimeException Hardware Error.
    For public interface details, consult the JCE API documentation for java.security.AlgorithmParameters.
    • Constructor Summary

      Constructors 
      Constructor Description
      AESParameters()
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte[] engineGetEncoded()
      Returns the initialization vector in DER encoding format.
      protected byte[] engineGetEncoded​(java.lang.String encodingMethod)
      Returns the initialization vector in DER encoding format.
      protected <T extends java.security.spec.AlgorithmParameterSpec>
      T
      engineGetParameterSpec​(java.lang.Class<T> paramSpec)
      Returns a (transparent) specification of this parameters object.
      protected void engineInit​(byte[] encoded)
      Imports the DER encoded parameters and decodes the initialization vector.
      protected void engineInit​(byte[] encoded, java.lang.String decodingMethod)
      Imports the the DER encoded parameters and decodes the initialization vector.
      protected void engineInit​(java.security.spec.AlgorithmParameterSpec paramSpec)
      Initializes this parameters object using the parameters specified in paramSpec.
      protected java.lang.String engineToString()
      Returns a formatted string describing the parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AESParameters

        public AESParameters()
        Constructor
    • Method Detail

      • engineInit

        protected void engineInit​(java.security.spec.AlgorithmParameterSpec paramSpec)
                           throws java.security.spec.InvalidParameterSpecException
        Initializes this parameters object using the parameters specified in paramSpec.
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Parameters:
        paramSpec - the AES parameter specification containing the initialization vector
        Throws:
        java.security.spec.InvalidParameterSpecException - if the given parameter specification is inappropriate for the initialization of this parameter object, or if the initialization vector is not 16 bytes long.
      • engineInit

        protected void engineInit​(byte[] encoded)
                           throws java.io.IOException
        Imports the DER encoded parameters and decodes the initialization vector.
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Parameters:
        encoded - the DER encoded initialization vector
        Throws:
        java.io.IOException - on decoding errors or if the initialization vector is not 16 bytes long.
      • engineInit

        protected void engineInit​(byte[] encoded,
                                  java.lang.String decodingMethod)
                           throws java.io.IOException
        Imports the the DER encoded parameters and decodes the initialization vector. The specified decodingMethod is ignored.
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Parameters:
        encoded - the DER encoded initialization vector
        decodingMethod - the name of the decoding format, which will be ignored
        Throws:
        java.io.IOException - on decoding errors or if the initialization vector is not 16 bytes long.
      • engineGetParameterSpec

        protected <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec​(java.lang.Class<T> paramSpec)
                                                                                          throws java.security.spec.InvalidParameterSpecException
        Returns a (transparent) specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned.
        Specified by:
        engineGetParameterSpec in class java.security.AlgorithmParametersSpi
        Parameters:
        paramSpec - the specification class in which the parameters should be returned. Should be javax.crypto.spec.IvParameterSpec or its subclass
        Throws:
        java.security.spec.InvalidParameterSpecException - if the requested parameter specification is inappropriate for this parameter object.
      • engineGetEncoded

        protected byte[] engineGetEncoded()
                                   throws java.io.IOException
        Returns the initialization vector in DER encoding format.
        Specified by:
        engineGetEncoded in class java.security.AlgorithmParametersSpi
        Returns:
        DER encoded initialization vector.
        Throws:
        java.io.IOException - on encoding errors.
      • engineGetEncoded

        protected byte[] engineGetEncoded​(java.lang.String encodingMethod)
                                   throws java.io.IOException
        Returns the initialization vector in DER encoding format.
        Specified by:
        engineGetEncoded in class java.security.AlgorithmParametersSpi
        Parameters:
        encodingMethod - the name of the encoding format, which will be ignored
        Returns:
        DER encoded initialization vector.
        Throws:
        java.io.IOException - on encoding errors.
      • engineToString

        protected java.lang.String engineToString()
        Returns a formatted string describing the parameters.
        Specified by:
        engineToString in class java.security.AlgorithmParametersSpi
        Returns:
        a formatted string describing the parameters.