Class AbstractAlgorithmParametersSpiImpl<P extends AlgorithmParameterSpec>

    • Constructor Detail

      • AbstractAlgorithmParametersSpiImpl

        protected AbstractAlgorithmParametersSpiImpl()
        Construct a new instance.
    • Method Detail

      • getParameterType

        protected abstract Class<P> getParameterType()
        Get the type of parameters for this class.
        Returns:
        the type of parameters for this class (must not be null)
      • engineInit

        protected final void engineInit​(byte[] params)
                                 throws IOException
        Implementation of the engineInit method.
        Specified by:
        engineInit in class AlgorithmParametersSpi
        Parameters:
        params - the encoded parameter specification
        Throws:
        IOException - if decoding failed
      • engineInit

        protected final void engineInit​(byte[] params,
                                        String format)
                                 throws IOException
        Implementation of the engineInit method.
        Specified by:
        engineInit in class AlgorithmParametersSpi
        Parameters:
        params - the encoded parameter specification
        format - the format (must be ASN.1)
        Throws:
        IOException - if decoding failed or the format is not equal to ASN.1
      • engineDecode

        protected abstract P engineDecode​(ASN1Decoder decoder)
                                   throws ASN1Exception,
                                          IOException
        Decode a parameter instance. Subclasses should ensure that all elements are consumed (including sequence terminators and so forth).
        Parameters:
        decoder - the decoder to use (not null)
        Returns:
        the parameter instance (must not be null)
        Throws:
        ASN1Exception - if there is a decoding problem (usually thrown directly by the ASN1Decoder)
        IOException - if some other decoding error occurred
      • engineGetEncoded

        protected final byte[] engineGetEncoded()
        Implementation of the engineGetEncoded method.
        Specified by:
        engineGetEncoded in class AlgorithmParametersSpi
        Returns:
        the encoded representation (not null)
      • engineGetEncoded

        protected final byte[] engineGetEncoded​(String format)
                                         throws IOException
        Implementation of the engineGetEncoded method.
        Specified by:
        engineGetEncoded in class AlgorithmParametersSpi
        Parameters:
        format - the format string (must not be null)
        Returns:
        the encoded representation (not null)
        Throws:
        IOException - if the given format is not ASN.1
      • checkInit

        private void checkInit()