Class GeneralAuthParameters<T extends GeneralAuthParameters>

    • Field Detail

      • macLenInBits

        protected final int macLenInBits
    • Constructor Detail

      • GeneralAuthParameters

        protected GeneralAuthParameters​(GeneralAlgorithm algorithm,
                                        int blockSize,
                                        byte[] iv,
                                        int macSizeInBits)
        Base Constructor that takes an iv (nonce) and a tag length.
        Parameters:
        algorithm - algorithm mode.
        blockSize - block size of the cipher in bytes.
        iv - iv, or nonce, to be used with this algorithm.
        macSizeInBits - length of the checksum tag in bits.
    • Method Detail

      • withIV

        public T withIV​(java.security.SecureRandom random,
                        int ivLen)
        Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.
        Specified by:
        withIV in interface AuthenticationParametersWithIV<T extends GeneralAuthParameters>
        Parameters:
        random - the SecureRandom to use as the source of IV data.
        ivLen - the length (in bytes) of the IV to be generated.
        Returns:
        a new instance of our parameterized type with a new IV.
      • withMACSize

        public T withMACSize​(int macSizeInBits)
        Create a parameter set with the specified MAC size associated with it.
        Specified by:
        withMACSize in interface AuthenticationParameters<T extends GeneralAuthParameters>
        Parameters:
        macSizeInBits - bit length of the MAC length.
        Returns:
        the new parameter set.