net.rim.device.api.database
Class DatabaseSecurityOptions

java.lang.Object
  extended by net.rim.device.api.database.DatabaseSecurityOptions

public final class DatabaseSecurityOptions
extends Object

Defines database security options.

Currently supported options:

If database is encrypted then it can be opened only on the device where it was originally created. Encrypted databases are not portable between devices. If application needs to restrict access to the database for its needs only then it should also protect data by code signing key. If two applications are signed with the same key that was used during database protection then both applications would have access to the database. This makes it easier to protect a database and restrict its access to friendly applications in the same group.

Note that there are no means to create non-encrypted database and restrict its usage to one application only. This is because there are other ways to read plain text database file from any application using file IO operations.

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 5.0.0

Constructor Summary
Category: Signed DatabaseSecurityOptions(boolean encrypted)
          Creates database security options based on encrypted property.
Category: Signed DatabaseSecurityOptions(int signerId)
          Creates database security options for encrypted and protected database.
Category: Signed DatabaseSecurityOptions(CodeSigningKey key)
          Creates database security options for encrypted and protected database.
 
Method Summary
Category: Signed  CodeSigningKey getCodeSigningKey()
          Returns code signing key for encrypted and protected databases.
Category: Signed  boolean isEncrypted()
          Returns encrypted database property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

DatabaseSecurityOptions

public DatabaseSecurityOptions(boolean encrypted)
Creates database security options based on encrypted property. The database will not be protected which means any application could access it.

Parameters:
encrypted - if true then the database file will be encrypted and not portable
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 5.0.0

DatabaseSecurityOptions

public DatabaseSecurityOptions(int signerId)
Creates database security options for encrypted and protected database. The database file will be encrypted and accessible only to those applications that are signed with the provided key.

Parameters:
signerId - numeric ID for the code signer
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 5.0.0

DatabaseSecurityOptions

public DatabaseSecurityOptions(CodeSigningKey key)
Creates database security options for encrypted and protected database. The database file will be encrypted and accessible only to those applications that are signed with the provided key.

Parameters:
key - the code signing key for this database
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 5.0.0


Method Detail

isEncrypted

public boolean isEncrypted()
Returns encrypted database property.

Returns:
true if database is encrypted false otherwise
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 5.0.0

getCodeSigningKey

public CodeSigningKey getCodeSigningKey()
Returns code signing key for encrypted and protected databases.

Returns:
key if database is protected, null otherwise
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 5.0.0





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.