|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.PKCS1UnformatterEngine
Provides the PKCS1 decoding 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 unformatter engine, click here.
PKCS1FormatterEngine| Constructor Summary | ||
|
PKCS1UnformatterEngine(PrivateKeyDecryptorEngine decryptorEngine)
Creates a PKCS1UnformatterEngine object that takes a PrivateKeyDecryptorEngine
that will be used for decrypting the ciphertext. |
|
| 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 PublicKeyDecryptorEngine.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 PKCS1UnformatterEngine(PrivateKeyDecryptorEngine decryptorEngine)
PKCS1UnformatterEngine object that takes a PrivateKeyDecryptorEngine
that will be used for decrypting the ciphertext.
decryptorEngine - The private key engine to decrypt the data with.| Method Detail |
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEngine
BlockUnformatterEngineinput - A byte array containing the encoded ciphertext.inputOffset - The offset, or initial bit position, of the data within the byte array.output - The byte array that will contain the plaintext.outputOffset - The offset, or initial bit position, of the data within the byte array.DecodeException - Thrown if the input cannot be decoded properly.BadPaddingException - Thrown if the input has improper padding.CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
public int decryptAndUnformat(byte[] input,
int inputOffset,
byte[] output,
int outputOffset,
boolean lastBlock)
throws DecodeException,
BadPaddingException,
CryptoTokenException
BlockUnformatterEngine
BlockUnformatterEngineinput - A byte array containing the encoded ciphertext.inputOffset - The offset, or initial bit position, of the data within the byte array.output - The byte array that will contain the plaintext.outputOffset - The offset, or initial bit position, of the data
within the byte array.lastBlock - A boolean flag indicating whether this is the last block in the
stream to be decrypted.DecodeException - Thrown if the input cannot be decoded properly.BadPaddingException - Thrown if the input has improper padding.CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.public String getAlgorithm()
PublicKeyDecryptorEngine.getAlgorithm() + "_PKCS1".
public int getInputBlockLength()
BlockUnformatterEngine
BlockUnformatterEnginepublic int getOutputBlockLength()
BlockUnformatterEngine
BlockUnformatterEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.