|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.Coder
public abstract class Coder
An abstract class that represents an encoding and decoding function, suitable for operations such as encryption and decryption, or compression and decompression.
A Coder object consists of two operations: An encoding operation, which transforms byte sequences into other byte sequences, and a corresponding decoding operation, which is the inverse of the encoding operation.
A Coder has a block size, which is the smallest length of a sequence which can be encoded or decoded. The length of any data which is input to the coder for encoding or decoding must be a multiple of the block size.
This is an abstract class. The following methods need to be implemented in a subclass:
algName
-- Returns the algorithm name.blockSize
-- Returns the block size.encodeOp
-- Encodes a single block of data.decodeOp
-- Decodes a single block of data.Constructor Summary | |
---|---|
protected |
Coder() Standard constructor. |
Method Summary | |
---|---|
abstract java.lang.String |
algName() Returns the name of the algorithm which this coder implements. |
byte[] |
decode(byte[] bytes) Decodes an entire array of bytes. |
byte[] |
decode(byte[] bytes, int offset, int length) Decode an array of bytes, with the specified offset and number of bytes. |
abstract byte[] |
decodeOp(byte[] bytes) Decodes an array whose length is exactly equal to the block size. |
byte[] |
encode(byte[] bytes) Encode an entire array of bytes. |
byte[] |
encode(byte[] bytes, int offset, int length) Encode array of bytes, with the specified offset and number of bytes. |
abstract byte[] |
encodeOp(byte[] bytes) Encode an array which is exactly blockSize length. |
abstract int |
getBlockSize() Returns the block size of the coder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Coder()
Method Detail |
---|
public abstract int getBlockSize()
public byte[] encode(byte[] bytes, int offset, int length) throws CoderException
bytes
- The bytes to be encoded.offset
- The index of the start of data.length
- The length of the data.CoderException
- If coder not initialized, block size incorrect, etc.public byte[] encode(byte[] bytes) throws CoderException
bytes
- The bytes to be encoded.CoderException
- If coder not initialized, block size incorrect, etc.public abstract byte[] encodeOp(byte[] bytes) throws CoderException
CoderException
- Thrown if blockSize is wrong.public byte[] decode(byte[] bytes, int offset, int length) throws CoderException
bytes
- The bytes to be encoded.offset
- The index of the start of data.length
- The length of the data.CoderException
- If coder not initialized, block size incorrect, etc.public byte[] decode(byte[] bytes) throws CoderException
bytes
- The data to be decoded.CoderException
- If coder not initialized, data is not a multiple of the block size, etc.public abstract byte[] decodeOp(byte[] bytes) throws CoderException
bytes
- The data to be decoded.CoderException
- If blockSize is wrong.public abstract java.lang.String algName()
|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |