Class RC2ParameterSpec

    • Constructor Summary

      Constructors 
      Constructor Description
      RC2ParameterSpec​(int effectiveKeyBits)
      Creates a new RC2ParameterSpec instance with the specified effective key length (in bits),
      RC2ParameterSpec​(int effectiveKeyBits, byte[] iv)
      Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.
      RC2ParameterSpec​(int effectiveKeyBits, byte[] iv, int offset)
      Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.
    • Constructor Detail

      • RC2ParameterSpec

        public RC2ParameterSpec​(int effectiveKeyBits)
        Creates a new RC2ParameterSpec instance with the specified effective key length (in bits),
        Parameters:
        effectiveKeyBits - the effective key length (in bits).
      • RC2ParameterSpec

        public RC2ParameterSpec​(int effectiveKeyBits,
                                byte[] iv)
        Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.

        The size of the initialization vector must be at least 8 bytes which are copied to protect them against modification.

        Parameters:
        effectiveKeyBits - the effective key length (in bits).
        iv - the initialization vector.
        Throws:
        IllegalArgumentException - if the initialization vector is null or shorter than 8 bytes.
      • RC2ParameterSpec

        public RC2ParameterSpec​(int effectiveKeyBits,
                                byte[] iv,
                                int offset)
        Creates a new RC2ParameterSpec instance with the specified effective key length (in bits) and initialization vector.

        The size of the initialization vector starting at offset must be at least 8 bytes which are copied to protect them against modification.

        Parameters:
        effectiveKeyBits - the effective key length (in bits).
        iv - the initialization vector.
        offset - the offset in the initialization vector to start at.
        Throws:
        IllegalArgumentException - if the initialization vector is null or starting at offset is shorter than 8 bytes.
    • Method Detail

      • getEffectiveKeyBits

        public int getEffectiveKeyBits()
        Returns the effective key length (in bits).
        Returns:
        the effective key length (in bits).
      • getIV

        public byte[] getIV()
        Returns a copy of the initialization vector.
        Returns:
        a copy of the initialization vector, or null if none specified.
      • equals

        public boolean equals​(Object obj)
        Compares the specified object to this RC2ParameterSpec instance.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare.
        Returns:
        true if the effective key length and the initialization vector of both objects are equal, otherwise false.
        See Also:
        Object.hashCode()