Class OxalisCipher


  • public class OxalisCipher
    extends Object
    Oxalis' cipher implementation. Encapsulates information required for encryption and decryption of data using a symmetric key.
    Author:
    steinar Date: 06.05.13 Time: 21:22
    • Field Detail

      • WRAPPED_SYMMETRIC_KEY_HEADER_NAME

        public static final String WRAPPED_SYMMETRIC_KEY_HEADER_NAME
        Name of our encrypted (wrapped) symmetric key. Typically used in HTTP headers, name and value pairs, etc.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OxalisCipher

        public OxalisCipher()
      • OxalisCipher

        public OxalisCipher​(SecretKey secretKey)
    • Method Detail

      • encryptStream

        public OutputStream encryptStream​(OutputStream outputStream)
        Wraps the supplied OutputStream in a encrypted cipher stream, i.e. every plain text byte written into the new OutputStream is encrypted using our SecretKey.
        Parameters:
        outputStream - the plaint text output stream to encrypted
        Returns:
        a new OutputStream which will encrypt every byte written to it.
        See Also:
        decryptStream(java.io.InputStream)
      • decryptStream

        public InputStream decryptStream​(InputStream inputStream)
        Wraps the supplied InputStream in a decrypted cipher stream, i.e. every encrypted byte read from the new InputStream reads is decrypted using our SecretKey.
        Parameters:
        inputStream - the encrypted input stream
        Returns:
        new InputStream which will decrypt every byte read from it.
      • getSecretKey

        public SecretKey getSecretKey()