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.

Your SQLite database can use the following database security options:

If the 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 an application needs to restrict access to the database for its needs only, then it should also protect data with the code signing key. If two applications are signed with the same key that was used during database protection, then both applications have access to the database. This makes it easier to protect a database and restrict its access to friendly applications in the same group.

There is no way to create a non-encrypted database and restrict its usage to only one application. This is because there are other ways (using file I/O operations) to read a plain-text database file from any application.

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 the encrypted property.
Category: Signed DatabaseSecurityOptions(int signerId)
          Creates database security options for an encrypted and protected database.
Category: Signed DatabaseSecurityOptions(CodeSigningKey key)
          Creates database security options for an encrypted and protected database.
 
Method Summary
Category: Signed  CodeSigningKey getCodeSigningKey()
          Returns the code signing key for encrypted and protected databases.
Category: Signed  boolean isEncrypted()
          Returns the 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 the encrypted property. Note that encryption does not prevent other applications from accessing the database.

Parameters:
encrypted - If true then the database file is 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 an encrypted and protected database. The database file is encrypted and accessible only to those applications that are signed with the provided key.

Parameters:
signerId - Numeric ID for the code signer. This ID can be accessed from CodeSigningKey.getSignerId().
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 an encrypted and protected database. The database file is 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 the encrypted database property.

Returns:
true if the 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 the code signing key for encrypted and protected databases.

Returns:
The code signing key if the 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-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