Package org.conscrypt

Class GCMParameters


  • @Internal
    public final class GCMParameters
    extends java.security.AlgorithmParametersSpi
    GCM parameters used during an ciphering operation with OpenSSLCipher. This class is used internally for backward compatibility with Android versions that did not have the GCMParameterSpec class, in addition to being the implementation of the GCM AlgorithmParameters implementation.

    The only supported encoding format is ASN.1, as specified in RFC 5084 section 3.2.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int DEFAULT_TLEN  
      private byte[] iv
      Actually the nonce value for the GCM operation.
      private int tLen
      The tag length in bits.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte[] engineGetEncoded()  
      protected byte[] engineGetEncoded​(java.lang.String format)  
      protected <T extends java.security.spec.AlgorithmParameterSpec>
      T
      engineGetParameterSpec​(java.lang.Class<T> aClass)  
      protected void engineInit​(byte[] bytes)  
      protected void engineInit​(byte[] bytes, java.lang.String format)  
      protected void engineInit​(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec)  
      protected java.lang.String engineToString()  
      (package private) byte[] getIV()
      Returns a non-cloned version of the IV.
      (package private) int getTLen()
      Returns the tag length in bits.
      • Methods inherited from class java.lang.Object

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

      • tLen

        private int tLen
        The tag length in bits.
      • iv

        private byte[] iv
        Actually the nonce value for the GCM operation.
    • Constructor Detail

      • GCMParameters

        public GCMParameters()
      • GCMParameters

        GCMParameters​(int tLen,
                      byte[] iv)
    • Method Detail

      • getTLen

        int getTLen()
        Returns the tag length in bits.
      • getIV

        byte[] getIV()
        Returns a non-cloned version of the IV.
      • engineInit

        protected void engineInit​(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec)
                           throws java.security.spec.InvalidParameterSpecException
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Throws:
        java.security.spec.InvalidParameterSpecException
      • engineInit

        protected void engineInit​(byte[] bytes)
                           throws java.io.IOException
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Throws:
        java.io.IOException
      • engineInit

        protected void engineInit​(byte[] bytes,
                                  java.lang.String format)
                           throws java.io.IOException
        Specified by:
        engineInit in class java.security.AlgorithmParametersSpi
        Throws:
        java.io.IOException
      • engineGetParameterSpec

        protected <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec​(java.lang.Class<T> aClass)
                                                                                          throws java.security.spec.InvalidParameterSpecException
        Specified by:
        engineGetParameterSpec in class java.security.AlgorithmParametersSpi
        Throws:
        java.security.spec.InvalidParameterSpecException
      • engineGetEncoded

        protected byte[] engineGetEncoded()
                                   throws java.io.IOException
        Specified by:
        engineGetEncoded in class java.security.AlgorithmParametersSpi
        Throws:
        java.io.IOException
      • engineGetEncoded

        protected byte[] engineGetEncoded​(java.lang.String format)
                                   throws java.io.IOException
        Specified by:
        engineGetEncoded in class java.security.AlgorithmParametersSpi
        Throws:
        java.io.IOException
      • engineToString

        protected java.lang.String engineToString()
        Specified by:
        engineToString in class java.security.AlgorithmParametersSpi