Package | flash.data |
Class | public class EncryptedLocalStore |
Inheritance | EncryptedLocalStore Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0 |
You may want to use the encrypted local store to store information that must be secured, such as login credentials for web services.
When testing an application in the AIR Debug Launcher (ADL), the application uses a different encrypted local store than is used by the installed AIR application.
AIR uses DPAPI on Windows®, KeyChain on Mac® OS®, and KeyRing or KWallet on Linux® to associate the encrypted local store to each application and user. The encrypted local store uses AES-CBC 128-bit encryption.
Information in the encrypted local store is available only to AIR application content in the application security sandbox.
Items in the encrypted local store are identified with a string. All items are stored as byte array data.
The encrypted local store may perform more slowly if the stored data exceeds 10MB.
When you uninstall an AIR application, the uninstaller does not delete data stored in the encrypted local store.
Encrypted local store data is put in a subdirectory of the user's application data directory; the subdirectory path is Adobe/AIR/ELS/ followed by the application ID.
Method | Defined By | ||
---|---|---|---|
[static]
Returns the data for the item with the given name in the encrypted local store. | EncryptedLocalStore | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
[static]
Removes the item with the given name from the encrypted local store. | EncryptedLocalStore | ||
[static]
Clears the entire encrypted local store, deleting all data. | EncryptedLocalStore | ||
[static]
Sets the item with the given name to the provided ByteArray data. | EncryptedLocalStore | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object |
getItem | () | method |
public static function getItem(name:String):ByteArray
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0 |
Returns the data for the item with the given name in the encrypted local store.
If an item does not exist by the specified name, this method returns null
.
Parameters
name:String — The name of the item in the encrypted local store.
|
ByteArray — The ByteArray data. If there is no data for the provided name ,
the method returns null .
|
Throws
ArgumentError — The name value is null or an empty string.
|
removeItem | () | method |
public static function removeItem(name:String):void
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0 |
Removes the item with the given name from the encrypted local store.
Parameters
name:String — The name of the item in the encrypted local store.
|
Throws
ArgumentError — The name value is null or an empty string.
|
reset | () | method |
public static function reset():void
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0 |
Clears the entire encrypted local store, deleting all data.
setItem | () | method |
public static function setItem(name:String, data:ByteArray, stronglyBound:Boolean = false):void
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0 |
Sets the item with the given name to the provided ByteArray data
.
Parameters
name:String — The name of the item in the encrypted local store.
| |
data:ByteArray — The data.
| |
stronglyBound:Boolean (default = false ) — If set to true , the stored item is strongly bound to the
digital signature and bits of the AIR application (the contents of the application directory),
in addition to the application's publisher ID.
A subsequent call to getItem() for this item results in a run-time exception if the
calling AIR application's bits do not match those of the storing application. If you update your
application, it cannot read strongly bound data that was previously written to the encrypted
local store.
If the |
Throws
ArgumentError — The name value is null or an empty string.
By default, an AIR application cannot read the encrypted local store of another application.
The |
var str:String = "Bob"; var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes(str); EncryptedLocalStore.setItem("firstName", bytes); var storedValue:ByteArray = EncryptedLocalStore.getItem("firstName"); trace(storedValue.readUTFBytes(storedValue.length)); // "Bob" EncryptedLocalStore.removeItem("firstName");
Fri Mar 19 2010, 02:45 AM -07:00