SHOW Signed

net.rim.device.api.crypto
Class PKCS5FormatterEngine

java.lang.Object
  |
  +--net.rim.device.api.crypto.PKCS5FormatterEngine
All Implemented Interfaces:
BlockFormatterEngine

public final class PKCS5FormatterEngine
extends Object
implements BlockFormatterEngine

Provides the PKCS5 encoding functionality on a block by block basis. The block length is the block length of the encryptor engine used.

We implemented the PKCS5 formatting as per PKCS #5 version 2.0 ( March 1999 ).

For a code sample using the PKCS5 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.

Since:
JDE 3.6.0
See Also:
PKCS5UnformatterEngine

Constructor Summary
 Category: Signed PKCS5FormatterEngine(BlockEncryptorEngine encryptorEngine)
          Creates a PKCS5FormatterEngine using a given BlockEncryptorEngine object for encrypting the plaintext.
 
Method Summary
 Category: Signed  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.
 Category: Signed  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.
 Category: Signed  String getAlgorithm()
          Returns the name of the algorithm used, ie BlockEncryptorEngine.getAlgorithm() + "/PKCS5".
 Category: Signed  int getInputBlockLength()
          Returns the length of an input block in bytes.
 Category: Signed  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

PKCS5FormatterEngine

public PKCS5FormatterEngine(BlockEncryptorEngine encryptorEngine)
Creates a PKCS5FormatterEngine using a given BlockEncryptorEngine object for encrypting the plaintext.

Parameters:
encryptorEngine - The engine used to encrypt the padded plaintext.
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.
Method Detail

getAlgorithm

public String getAlgorithm()
Returns the name of the algorithm used, ie BlockEncryptorEngine.getAlgorithm() + "/PKCS5".

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.

getInputBlockLength

public int getInputBlockLength()
Description copied from interface: BlockFormatterEngine
Returns the length of an input block in bytes.

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.

getOutputBlockLength

public int getOutputBlockLength()
Description copied from interface: BlockFormatterEngine
Returns the length of an output block in bytes.

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.

formatAndEncrypt

public int formatAndEncrypt(byte[] input,
                            int inputOffset,
                            int inputLength,
                            byte[] output,
                            int outputOffset,
                            boolean lastBlock)
                     throws MessageTooLongException,
                            CryptoTokenException
Description copied from interface: BlockFormatterEngine
Formats the input into the proper format and then encrypts it.

Since:
JDE 4.0.2
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.

formatAndEncrypt

public int formatAndEncrypt(byte[] input,
                            int inputOffset,
                            int inputLength,
                            byte[] output,
                            int outputOffset)
                     throws MessageTooLongException,
                            CryptoTokenException
Description copied from interface: BlockFormatterEngine
Formats the input into the proper format and then encrypts it, assuming this is not the last block to be encrypted.

Since:
JDE 4.0.2
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.