|
Oracle Security Developer Tools Crypto Java API Reference 10g Release 2 (10.1.2.0.2) B15565-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.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() |
Method Summary | |
abstract java.lang.String |
algName() Returns the name of the algorithm which this coder implements. |
abstract int |
blockSize() Deprecated. Use getBlockSize() instead. |
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. |
void |
initialize() Deprecated. This method has no effect, and all usages of it may be removed without problems. |
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 blockSize()
public abstract int getBlockSize()
public byte[] encode(byte[] bytes, int offset, int length) throws CoderException
bytes
- bytes to be encodedCoderException
- thrown if coder not initialized, block size incorrect, etc.public byte[] encode(byte[] bytes) throws CoderException
bytes
- bytes to be encodedCoderException
- thrown 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
- bytes to be encodedCoderException
- thrown if coder not initialized, block size incorrect, etc.public byte[] decode(byte[] bytes) throws CoderException
bytes
- data to be decodedCoderException
- if coder not initialized, data is not a multiple of the block size, etc.public abstract byte[] decodeOp(byte[] bytes) throws CoderException
CoderException
- thrown if blockSize is wrong.public abstract java.lang.String algName()
public void initialize()
|
Oracle Security Developer Tools Crypto Java API Reference 10g Release 2 (10.1.2.0.2) B15565-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |