SHOW Signed SHOW Certicom
 

net.rim.device.api.crypto
Class ECIESEncryptor

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--net.rim.device.api.crypto.CryptoOutputStream
              |
              +--net.rim.device.api.crypto.EncryptorOutputStream
                    |
                    +--net.rim.device.api.crypto.StreamEncryptor
                          |
                          +--net.rim.device.api.crypto.ECIESEncryptor

public final class ECIESEncryptor
extends StreamEncryptor

ECIESEncryptor is a class used to encrypt messages with the Elliptic Curve Integrated Encryption Scheme ( ECIES ). It is described in ANSI X9.63.

Elliptic Curve cryptography is defined in various standards including P1363 and ANSI X9.62.

For information on cryptographic algorithms, see Crypto Algorithms.

Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0
See Also:
ECIESDecryptor

Field Summary
 
Fields inherited from class net.rim.device.api.crypto.CryptoOutputStream
_out
 
Constructor Summary
 Category: Certicom Category: Signed ECIESEncryptor(OutputStream out, ECPublicKey recipientPublicKey)
          Creates an ECIESEncryptor class.
 Category: Certicom Category: Signed ECIESEncryptor(OutputStream out, ECPublicKey recipientPublicKey, String macAlgorithm, int macKeyLength, byte[] additionalMACInfo, int macLength, byte[] additionalKDFInfo, Digest kdfDigest, boolean useCofactor)
          Creates an ECIESEncryptor class.
 
Method Summary
 Category: Certicom Category: Signed  void close()
          Closes the output stream.
 Category: Certicom Category: Signed protected  void encrypt(byte[] plaintext, int plaintextOffset, int plaintextLength, byte[] ciphertext)
          Encrypts data using the specific implementation of the chosen stream encryptor.
 Category: Certicom Category: Signed  String getAlgorithm()
          Returns the name of this algorithm, namely "ECIES/" + macAlgorithm.
 
Methods inherited from class net.rim.device.api.crypto.StreamEncryptor
flush, write
 
Methods inherited from class net.rim.device.api.crypto.CryptoOutputStream
flush, getOutputStream, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECIESEncryptor

public ECIESEncryptor(OutputStream out,
                      ECPublicKey recipientPublicKey)
               throws CryptoTokenException,
                      CryptoUnsupportedOperationException,
                      InvalidCryptoSystemException,
                      IOException,
                      NoSuchAlgorithmException
Creates an ECIESEncryptor class. The MAC algorithm used is HMAC with SHA1 and a 20 byte mac key. Note that the cofactor is used in the shared secret calculation and the digest used in the KDF is SHA1.

Parameters:
out - The output stream to write too.
recipientPublicKey - The public key of the person this message will go to.
Throws:
CryptoTokenException - Thrown if a crypto token error occurs.
CryptoUnsupportedOperationException - Thrown if the attempted operation is not supported.
InvalidCryptoSystemException - Thrown if the crypto system has a problem with it.
IOException - Thrown if there is a problem writing to the output stream
NoSuchAlgorithmException - Thrown if the mac algorithm is not supported
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.


ECIESEncryptor

public ECIESEncryptor(OutputStream out,
                      ECPublicKey recipientPublicKey,
                      String macAlgorithm,
                      int macKeyLength,
                      byte[] additionalMACInfo,
                      int macLength,
                      byte[] additionalKDFInfo,
                      Digest kdfDigest,
                      boolean useCofactor)
               throws CryptoTokenException,
                      CryptoUnsupportedOperationException,
                      InvalidCryptoSystemException,
                      IOException,
                      NoSuchAlgorithmException
Creates an ECIESEncryptor class.

Parameters:
out - The output stream to write too.
recipientPublicKey - The public key of the person this message will go to.
macAlgorithm - The MAC algorithm to use. If null, then "HMAC/SHA1" is used.
macKeyLength - The length of the MAC key to use.
additionalMACInfo - Additional mac information to provided to the MAC.
additionalKDFInfo - Additional shared information to provide to the KDF.
kdfDigest - Specifies the digest to use in the KDF. If null, then SHA1 is used.
useCofactor - If this true, a the elliptic curve's cofactor is used in the calculations. If false, the cofactor is not used. Note, setting this value to TRUE is the most common usage.
Throws:
CryptoTokenException - Thrown if a crypto token error occurs.
CryptoUnsupportedOperationException - Thrown if the attempted operation is not supported.
InvalidCryptoSystemException - Thrown if the crypto system has a problem with it.
IOException - Thrown if there is a problem writing to the output stream
NoSuchAlgorithmException - Thrown if the mac algorithm is not supported
Since:
JDE 3.6.0
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Method Detail

close

public void close()
           throws IOException
Description copied from class: CryptoOutputStream
Closes the output stream.

Before closing the stream, it flushes out all of the data that is in the output stream.

See the flush() method for more information.

Overrides:
close in class CryptoOutputStream
Since:
JDE 3.6.0

Following copied from class: CryptoOutputStream
Throws:
IOException - Thrown if an I/O error occurs.
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.


encrypt

protected void encrypt(byte[] plaintext,
                       int plaintextOffset,
                       int plaintextLength,
                       byte[] ciphertext)
                throws CryptoTokenException
Description copied from class: StreamEncryptor
Encrypts data using the specific implementation of the chosen stream encryptor.

Overrides:
encrypt in class StreamEncryptor
Since:
JDE 3.6.0

Following copied from class: StreamEncryptor
Parameters:
plaintext - A byte array containing the input to the stream cipher.
plaintextOffset - The offset, or initial position within the array, of the information to encrypt.
length - The length of the information to encrypt.
ciphertext - A byte array to hold the output of the stream cipher.
Throws:
CryptoTokenException - Thrown when a problem occurs with the crypto token or the crypto token is invalid.
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.


getAlgorithm

public String getAlgorithm()
Returns the name of this algorithm, namely "ECIES/" + macAlgorithm.
Overrides:
getAlgorithm in class CryptoOutputStream
Since:
JDE 3.6.0

Following copied from class: CryptoOutputStream
Returns:
A String that represents the name of the algorithm.
Category:
Certicom: This element is part of the Certicom Cryptography APIs. The Certicom Cryptography APIs provide the tools you need, including ECC based algorithms, to integrate high performance data security into your applications, such as public key data encryption and decryption, digital signatures, and data authentication. Since the Certicom Cryptography API is already in the JDE, its use will remove the need for you to engage in time and resource intensive security integration so that you have lower development costs and a faster time to market. Use of the Certicom Cryptography API requires a license from Certicom. Please contact Certicom directly for more information on licensing fees and conditions.

Certicom Contact Information

Phone:613-254-9258

Email: sales@certicom.com

Website: http://www.certicom.com/rim
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.




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.