|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.PKCS5UnformatterEngine
Provides the PKCS#5 padding scheme. The scheme pads the plaintext to the size of the block length and uses the number of bytes used for this padding as the actual byte to pad with. That is, if there are two bytes that needed to be padded out to get the correct block length then the two bytes used for padding would be 0x02.
We implemented the PKCS5 formatting as per PKCS #5 version 2.0 ( March 1999 ).
For a code sample using the PKCS5 unformatter engine, click here.
PKCS5FormatterEngine| Constructor Summary | ||
|
PKCS5UnformatterEngine(BlockDecryptorEngine decryptorEngine)
Creates a PKCS5UnformatterEngine object using a given SymmetricKeyDecryptorEngine
for decrypting the plaintext.
|
|
| Method Summary | ||
|
int |
decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
Decrypts the input and then "unformats" it into the original plaintext assuming this block is not the last block in the stream. |
|
int |
decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset,
boolean lastBlock)
Decrypts the input and then "unformats" it into the original plaintext. |
|
String |
getAlgorithm()
Returns the name of the algorithm used, ie SymmetricKeyDecryptorEngine.getAlgorithm() + "/PKCS5".
|
|
int |
getInputBlockLength()
Returns the length of an input block in bytes. |
|
int |
getOutputBlockLength()
Returns the length of an output block in bytes. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PKCS5UnformatterEngine(BlockDecryptorEngine decryptorEngine)
PKCS5UnformatterEngine object using a given SymmetricKeyDecryptorEngine
for decrypting the plaintext.
decryptorEngine - The engine that will be used to decrypt the data.| Method Detail |
public String getAlgorithm()
SymmetricKeyDecryptorEngine.getAlgorithm() + "/PKCS5".
getAlgorithm in interface BlockUnformatterEnginepublic int getInputBlockLength()
BlockUnformatterEnginegetInputBlockLength in interface BlockUnformatterEnginenet.rim.device.api.crypto.BlockUnformatterEnginepublic int getOutputBlockLength()
BlockUnformatterEnginegetOutputBlockLength in interface BlockUnformatterEnginenet.rim.device.api.crypto.BlockUnformatterEngine
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset,
boolean lastBlock)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEnginedecryptAndUnformat in interface BlockUnformatterEngine
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEnginedecryptAndUnformat in interface BlockUnformatterEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.