SHOW Signed
 

net.rim.device.api.util
Class ContentProtectedHashtable

java.lang.Object
  |
  +--java.util.Hashtable
        |
        +--net.rim.device.api.util.ContentProtectedHashtable
All Implemented Interfaces:
Persistable, Persistable, PersistentContentListener

public class ContentProtectedHashtable
extends Hashtable
implements Persistable, PersistentContentListener

This class provides a hashtable that will employ content protection on the values stored in the hashtable. Note that it does NOT protect the keys in the hashtable.

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:
4.0

Field Summary
 
Fields inherited from interface net.rim.device.api.system.PersistentContentListener
PERSISTENT_CONTENT_LOCKED_INSECURE, PERSISTENT_CONTENT_LOCKED_SECURE, PERSISTENT_CONTENT_LOCKING, PERSISTENT_CONTENT_UNLOCKED
 
Constructor Summary
 Category: Signed ContentProtectedHashtable()
          Creates a new, empty ContentProtectedHashtable using the default capacity and automatically protects the values in the hashtable.
 Category: Signed ContentProtectedHashtable(boolean protect)
          Creates a new, empty ContentProtectedHashtable using the default capacity.
 Category: Signed ContentProtectedHashtable(Hashtable hashtable, boolean protect)
          Creates a new ContentProtectedHashtable with the contents currently found in the Hashtable passed into this method.
 Category: Signed ContentProtectedHashtable(int initialCapacity)
          Creates a new, empty ContentProtectedHashtable using the initial capacity and automatically protects the values in the hashtable.
 Category: Signed ContentProtectedHashtable(int initialCapacity, boolean protect)
          Creates a new, empty ContentProtectedHashtable.
 
Method Summary
 Category: Signed  boolean checkCrypt()
          This method will return a boolean indicating if the protection setting of this hashtable matches that of the user's content protection settings.
 Category: Signed  boolean contains(Object value)
          Determines if some key maps into the specified value in this hashtable.
 Category: Signed  Enumeration elements()
          Retrieves an enumeration of the values in this hashtable.
 Category: Signed  Object get(Object key)
          Retrieves value by key.
 Category: Signed  boolean isProtected()
          This method will return a boolean indicating if the values in this hashtable are currently being protected by content protection.
 Category: Signed  void persistentContentModeChanged(int generation)
          Invoked when the persistent content mode changes, i.e., the Content Protection/Compression security settings on the device change.
 Category: Signed  void persistentContentStateChanged(int state)
          Invoked when the persistent content state changes (e.g., the device changes from locked to unlocked).
 Category: Signed  Object put(Object key, Object value)
          Maps value to key in this hashtable.
 Category: Signed  void reCrypt()
          This method will enable protection and cause all the current contents to be encrypted according to the user's content protection settings.
 
Methods inherited from class java.util.Hashtable
clear, containsKey, isEmpty, keys, rehash, remove, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentProtectedHashtable

public ContentProtectedHashtable()
Creates a new, empty ContentProtectedHashtable using the default capacity and automatically protects the values in the hashtable.
Since:
JDE 4.0.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.

ContentProtectedHashtable

public ContentProtectedHashtable(boolean protect)
Creates a new, empty ContentProtectedHashtable using the default capacity.
Parameters:
protect - a boolean indicating whether or not the values to be stored in the hashtable should be encrypted when placed in the hashtable or only when it is deemed necessary via the reCrypt call.
Since:
JDE 4.0.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.

ContentProtectedHashtable

public ContentProtectedHashtable(Hashtable hashtable,
                                 boolean protect)
Creates a new ContentProtectedHashtable with the contents currently found in the Hashtable passed into this method.
Parameters:
hashtable - the hashtable to use for populating the ContentProtectedHashtable.
protect - a boolean indicating whether or not to encrypt the values of the hashtable.
Since:
JDE 4.0.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.

ContentProtectedHashtable

public ContentProtectedHashtable(int initialCapacity)
Creates a new, empty ContentProtectedHashtable using the initial capacity and automatically protects the values in the hashtable.
Parameters:
initialCapacity - the initial capacity of the hashtable.
Since:
JDE 4.0.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.

ContentProtectedHashtable

public ContentProtectedHashtable(int initialCapacity,
                                 boolean protect)
Creates a new, empty ContentProtectedHashtable.
Parameters:
initialCapacity - the initial capacity of the hashtable.
protect - a boolean indicating whether or not the values to be stored in the hashtable should be encrypted when placed in the hashtable or only when it is deemed necessary via the reCrypt call.
Since:
JDE 4.0.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.
Method Detail

checkCrypt

public boolean checkCrypt()
This method will return a boolean indicating if the protection setting of this hashtable matches that of the user's content protection settings.
Returns:
true if the values are being protected according to the user's settings and false otherwise.
Since:
JDE 4.0.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.

contains

public boolean contains(Object value)
Determines if some key maps into the specified value in this hashtable. Note if protection is enabled and value is a byte array, then contains() will return false.

This operation is more expensive than Hashtable.containsKey(java.lang.Object).

Overrides:
contains in class Hashtable
Parameters:
value - Value to search for.
Returns:
True if some key maps to the provided value in this hashtable; otherwise, false.
Throws:
NullPointerException - If null value provided.
Since:
JDE 4.0.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.

elements

public Enumeration elements()
Retrieves an enumeration of the values in this hashtable.

Use the Enumeration methods on the returned object to fetch the elements sequentially.

Overrides:
elements in class Hashtable
Returns:
Enumeration of the values in this hashtable.
Since:
JDE 4.0.0
See Also:
Enumeration, Hashtable.keys()
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.

get

public Object get(Object key)
Retrieves value by key.

Overrides:
get in class Hashtable
Parameters:
key - Key in this hashtable.
Returns:
Object value associated with provided key, or null if no object associated with the key.
Since:
JDE 4.0.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.

isProtected

public boolean isProtected()
This method will return a boolean indicating if the values in this hashtable are currently being protected by content protection.
Returns:
true if the values are being protected and false otherwise.
Since:
JDE 4.0.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.

persistentContentModeChanged

public void persistentContentModeChanged(int generation)
Description copied from interface: PersistentContentListener
Invoked when the persistent content mode changes, i.e., the Content Protection/Compression security settings on the device change.

Listeners should call PersistentContent.checkEncoding(java.lang.Object) to see if they need to call PersistentContent.reEncode(java.lang.Object).

Listeners should periodically compare the generation parameter to PersistentContent.getModeGeneration(). If they are different, then the listeners should terminate their checkEncoding/reEncoding loops because the security settings on the device have changed and they will have to be rechecked and/or re-encoded anyway.

Since:
JDE 4.0.0

Following copied from interface: PersistentContentListener
Parameters:
generation - Used to determine if the user has changed the content protection settings since the listener was notified.
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.

persistentContentStateChanged

public void persistentContentStateChanged(int state)
Description copied from interface: PersistentContentListener
Invoked when the persistent content state changes (e.g., the device changes from locked to unlocked).
Since:
JDE 4.0.0

Following copied from interface: PersistentContentListener
Parameters:
state - New state.
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.

put

public Object put(Object key,
                  Object value)
Maps value to key in this hashtable.

The value can be retrieved by invoking get(java.lang.Object) with a key that is equal to the original key (as determined by Object.equals(java.lang.Object).

Overrides:
put in class Hashtable
Parameters:
key - Key to associate with the value.
value - Value to put into table.
Returns:
Previous value associated with key, or null if key had no previous associated value.
Throws:
NullPointerException - If null key or null value.
Since:
JDE 4.0.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.

reCrypt

public void reCrypt()
This method will enable protection and cause all the current contents to be encrypted according to the user's content protection settings.
Since:
JDE 4.0.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.



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.