|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.PKCS1FormatterEngine
The PKCS1FormatterEngine class provides the PKCS1 encoding functionality on a block
by block basis. The block length is the size of the modulus of an
EncryptorEngine minus the overhead.
We implemented the PKCS1 formatter engine as per the PKCS #1 version 2.1 document.
For a code sample using the PKCS1 formatter engine, click here.
PKCS1UnformatterEngine| Constructor Summary | ||
|
PKCS1FormatterEngine(PublicKeyEncryptorEngine encryptorEngine)
Creates a PKCS1FormatterEngine object that takes a
PublicKeyEncryptorEngine object
that will be used for encrypting the ciphertext.
|
|
| Method Summary | ||
|
int |
formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset)
Formats the input into the proper format and then encrypts it, assuming this is not the last block to be encrypted. |
|
int |
formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset,
boolean lastBlock)
Formats the input into the proper format and then encrypts it. |
|
String |
getAlgorithm()
Returns the name of the algorithm used, ie PublicKeyEncryptorEngine.getAlgorithm() + "_PKCS1".
|
|
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 PKCS1FormatterEngine(PublicKeyEncryptorEngine encryptorEngine)
PKCS1FormatterEngine object that takes a
PublicKeyEncryptorEngine object
that will be used for encrypting the ciphertext.
encryptorEngine - The private key engine to encrypt the data with.| Method Detail |
public String getAlgorithm()
PublicKeyEncryptorEngine.getAlgorithm() + "_PKCS1".
getAlgorithm in interface BlockFormatterEnginepublic int getInputBlockLength()
BlockFormatterEnginegetInputBlockLength in interface BlockFormatterEnginenet.rim.device.api.crypto.BlockFormatterEnginepublic int getOutputBlockLength()
BlockFormatterEnginegetOutputBlockLength in interface BlockFormatterEnginenet.rim.device.api.crypto.BlockFormatterEngine
public int formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset,
boolean lastBlock)
throws MessageTooLongException,
CryptoTokenException
BlockFormatterEngineformatAndEncrypt in interface BlockFormatterEngine
public int formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset)
throws MessageTooLongException,
CryptoTokenException
BlockFormatterEngineformatAndEncrypt in interface BlockFormatterEngine
|
|||||||||
| 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.