SHOW Signed SHOW CryptoExtensionAPI
 

net.rim.device.api.crypto
Interface SymmetricKey

All Superinterfaces:
Key, Persistable, Persistable
All Known Implementing Classes:
AESKey, ARC4Key, CAST128Key, DESKey, RC2Key, RC5Key, SkipjackKey, TripleDESKey, HMACKey

public interface SymmetricKey
extends Key

SymmetricKey is an interface representing a key to be used in a symmetric key cryptographyic system.

A symmetric key system implies the same key is used for both decryption and encryption.

Category:
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:
SymmetricKeyFactory

Method Summary
 Category: Signed  int getBitLength()
          Returns the number of bits that make up the actual keying material ( for example parity bits are not counted ).
 Category: Signed  byte[] getData()
          Returns a copy of the byte array representing the key.
 Category: Signed  int getLength()
          Returns the length of the key in bytes.
 Category: CryptoExtensionAPI Category: Signed  SymmetricCryptoToken getSymmetricCryptoToken()
          Returns the crypto token associated with this key.
 
Methods inherited from interface net.rim.device.api.crypto.Key
getAlgorithm
 

Method Detail

getBitLength

public int getBitLength()
                 throws CryptoTokenException,
                        CryptoUnsupportedOperationException
Returns the number of bits that make up the actual keying material ( for example parity bits are not counted ).

Returns:
An integer that represents the number of bits in the key.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
Since:
JDE 3.6.0
Category:
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.

getData

public byte[] getData()
               throws CryptoTokenException,
                      CryptoUnsupportedOperationException
Returns a copy of the byte array representing the key.

Returns:
A byte array containing the key.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
Since:
JDE 3.6.0
Category:
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.

getLength

public int getLength()
              throws CryptoTokenException,
                     CryptoUnsupportedOperationException
Returns the length of the key in bytes.

Returns:
An integer that represents the number of bytes.
Throws:
CryptoTokenException - Thrown when a problem occurs with a crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
Since:
JDE 3.6.0
Category:
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.

getSymmetricCryptoToken

public SymmetricCryptoToken getSymmetricCryptoToken()
Returns the crypto token associated with this key.
Since:
JDE 3.6.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.