org.dasein.cloud.encryption
Interface Encryption


public interface Encryption

Raw interface to be implemented for different encryption algorithms. An implementation is expected to store the keys to be used for encrypting or decrypting data and then encrypt/decrypt a data stream on-demand.

Author:
George Reese @ enStratus (http://www.enstratus.com)

Method Summary
 void clear()
          Triggered by cloud provider implementations when done with any encryption/decryption.
 void decrypt(InputStream encryptedData, OutputStream rawData)
          Decrypts an incoming encrypted stream of data and sends the de-crypted contents to the specified output stream.
 void encrypt(InputStream rawData, OutputStream encryptedData)
          Encrypts an incoming stream of raw data and sends the encrypted data to the specified output stream.
 

Method Detail

clear

void clear()
Triggered by cloud provider implementations when done with any encryption/decryption. Implementations should generally call ProviderContext.clear(byte[][]) passing in any encryption keys used by this object.


decrypt

void decrypt(InputStream encryptedData,
             OutputStream rawData)
             throws EncryptionException
Decrypts an incoming encrypted stream of data and sends the de-crypted contents to the specified output stream.

Parameters:
encryptedData - the encrypted data stream
rawData - the de-crypted output stream
Throws:
EncryptionException - an error occurred decrypting the data

encrypt

void encrypt(InputStream rawData,
             OutputStream encryptedData)
             throws EncryptionException
Encrypts an incoming stream of raw data and sends the encrypted data to the specified output stream.

Parameters:
rawData - the original data in the form of an input stream
encryptedData - the output stream into which the encrypted data is placed
Throws:
EncryptionException - an error occurred encrypting the data