net.rim.device.api.crypto
Interface SymmetricKey

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

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.

See Also:
SymmetricKeyFactory
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:
BlackBerry API 3.6.0

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: Signed  SymmetricCryptoToken getSymmetricCryptoToken()
          Returns the crypto token associated with this key.
 
Methods inherited from interface net.rim.device.api.crypto.Key
getAlgorithm
 



Method Detail

getLength

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.
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:
BlackBerry API 3.6.0

getData

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.
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:
BlackBerry API 3.6.0

getBitLength

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.
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:
BlackBerry API 3.6.0

getSymmetricCryptoToken

SymmetricCryptoToken getSymmetricCryptoToken()
Returns the crypto token associated with this key.

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:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal