HDIV API 2.0.4

org.hdiv.cipher
Interface ICipherHTTP

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CipherHTTP, MockCipherHTTP

public interface ICipherHTTP
extends java.io.Serializable

The main interface for cryptography functions

Author:
Roberto Velasco

Method Summary
 byte[] decrypt(byte[] data)
          Decrypts data in a single-part operation, or finishes a multiple-part operation.
 byte[] encrypt(byte[] data)
          Encrypts data in a single-part operation, or finishes a multiple-part operation.
 void initDecryptMode(Key key)
          Generates a Cipher object that implements the specified transformation, initializes cipher vector and initializes cipher to decryption mode with a key and a set of algorithm parameters.
 void initEncryptMode(Key key)
          Generates a Cipher object that implements the specified transformation, initializes cipher vector and initializes cipher to encryption mode with a key and a set of algorithm parameters.
 

Method Detail

initEncryptMode

void initEncryptMode(Key key)
Generates a Cipher object that implements the specified transformation, initializes cipher vector and initializes cipher to encryption mode with a key and a set of algorithm parameters.

Parameters:
key - the encryption key
Throws:
HDIVException - if there is an initialization error.

initDecryptMode

void initDecryptMode(Key key)
Generates a Cipher object that implements the specified transformation, initializes cipher vector and initializes cipher to decryption mode with a key and a set of algorithm parameters.

Parameters:
key - the encryption key
Throws:
HDIVException - if there is an initialization error.

encrypt

byte[] encrypt(byte[] data)
Encrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted depending on how this cipher was initialized.

The bytes in the input buffer, and any input bytes that may have been buffered during a previous update operation, are processed, with padding (if requested) being applied. The result is stored in a new buffer.

if any exception is thrown, this cipher object may need to be reset before it can be used again.

Parameters:
data - The input buffer to encrypt
Returns:
The new buffer with the result

decrypt

byte[] decrypt(byte[] data)
Decrypts data in a single-part operation, or finishes a multiple-part operation. The data is decrypted depending on how this cipher was initialized.

The bytes in the input buffer, and any input bytes that may have been buffered during a previous update operation, are processed, with padding (if requested) being applied. The result is stored in a new buffer.

if any exception is thrown, this cipher object may need to be reset before it can be used again.

Parameters:
data - The input buffer to decrypt
Returns:
The new buffer with the result

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.