Class CipherSpec

  • Direct Known Subclasses:
    AesGcmCipherSpec, HmacSha256CipherSpec, TwofishGcmCipherSpec

    public abstract class CipherSpec
    extends java.lang.Object
    A cipher spec represents the definition of a cipher/encryption algorithm and the corresponding settings required to instantiate a new cipher object.

    Cipher specs are identified by an identifier (id), which will (when the cipher spec is used by the MultiCipherOutputStream) be written to the output file format. When the file is read by MultiCipherInputStream, the identifier is looked up using the CipherSpecs class.

    While it would be technically possible to define any kind of cipher using this class, this class restricts the allowed algorithms to a few ones that are considered secure.

    Instantiating a cipher spec that does pass the sanity checks will result in a RuntimeException.

    • Constructor Detail

      • CipherSpec

        public CipherSpec​(int id,
                          java.lang.String algorithm,
                          int keySize,
                          int ivSize,
                          boolean needsUnlimitedStrength)