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.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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)
int
formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset,
boolean lastBlock)
Creates a PKCS1FormatterEngine object that takes a
PublicKeyEncryptorEngine object
that will be used for encrypting the ciphertext.
Parameters:
encryptorEngine - The private key engine to encrypt the data with.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Returns the name of the algorithm used, ie
PublicKeyEncryptorEngine.getAlgorithm() + "_PKCS1".
Returns:
A String that represents the name of the algorithm.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
formatAndEncrypt
public int formatAndEncrypt(byte[] input,
int inputOffset,
int inputLength,
byte[] output,
int outputOffset,
boolean lastBlock)
throws MessageTooLongException,
CryptoTokenException
Formats the input into the proper format and then encrypts it.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Formats the input into the proper format and then encrypts it, assuming
this is not the last block to be encrypted.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Copyright 1999-2004 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.