適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.data.crypto 

EncryptionKeyGenerator  - AS3 ADEP Data Services

套件mx.data.crypto
類別public class EncryptionKeyGenerator
繼承EncryptionKeyGenerator Inheritance Object

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
執行階段版本: Flash Player 9, AIR 1.1

The EncryptionKeyGenerator class generates an encryption key value, such as you would use to encrypt files or data. For example, the encryption key is suitable to use as an encryption key for an encrypted AIR local SQL (SQLite) database.

This class uses techniques and algorithms that are designed for maximum data privacy and security. Use this class to generate an encryption key if your application requires data to be encrypted on a per-user level (in other words, if only one user of the application should be able to access his or her data). In some situations you may also want to use per-user encryption for data even if the application design specifies that other users can access the data. For more information, see "Considerations for using encryption with a database" in the guide "Developing Adobe AIR Applications with Flex."

The generated encryption key is based on a password that you provide. For any given password, in the same AIR application running in the same user account on the same machine, the encryption key result is the same.

To generate an encryption key from a password, use the getEncryptionKey() method. To confirm that a password is a "strong" password before calling the getEncryptionKey() method, use the validateStrongPassword() method.

In addition, the EncryptionKeyGenerator includes a utility constant, ENCRYPTED_DB_PASSWORD_ERROR_ID. This constant matches the error ID of the SQLError error that occurs when code that is attempting to open an encrypted database provides the wrong encryption key.

This class is designed to create an encryption key suitable for providing the highest level of data privacy and security. In order to achieve that level of security, a few security principles must be followed:

  • Your application should never store the user-entered password
  • Your application should never store the encryption key returned by the getEncryptionKey() method.
  • Instead, each time the user runs the application and attempts to access the database, your application code should call the getEncryptionKey() method to regenerate the encryption key.

For more information about data security, and an explanation of the security techniques used in the EncryptionKeyGenerator class, see "Example: Generating and using an encryption key" in the guide "Developing Adobe AIR Applications with Flex."



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
公用方法
 方法定義自
  
Creates a new EncryptionKeyGenerator instance.
EncryptionKeyGenerator
  
getEncryptionKey(password:String, overrideSaltELSKey:String = null):ByteArray
Uses a password to generate a 16-byte encryption key.
EncryptionKeyGenerator
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
  
Checks a password and returns a value indicating whether the password is a "strong" password.
EncryptionKeyGenerator
 Inherited
會傳回指定之物件的基本值。
Object
公用常數
 常數定義自
  ENCRYPTED_DB_PASSWORD_ERROR_ID : uint = 3138
[靜態] This constant matches the error ID (3138) of the SQLError error that occurs when code that is attempting to open an encrypted database provides the wrong encryption key.
EncryptionKeyGenerator
建構函式詳細資料

EncryptionKeyGenerator

()建構函式
public function EncryptionKeyGenerator()

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
執行階段版本: Flash Player 9, AIR 1.1

Creates a new EncryptionKeyGenerator instance.

方法詳細資訊

getEncryptionKey

()方法
public function getEncryptionKey(password:String, overrideSaltELSKey:String = null):ByteArray

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
執行階段版本: Flash Player 9, AIR 1.1

Uses a password to generate a 16-byte encryption key. The return value is suitable to use as an encryption key for an encrypted AIR local SQL (SQLite) database.

For any given password, calling the getEncryptionKey() method from the same AIR application running in the same user account on the same machine, the encryption key result is the same.

This method is designed to create an encryption key suitable for providing the highest level of data privacy and security. In order to achieve that level of security, your application must follow several security principles:

  • Your application can never store the user-entered password
  • Your application can never store the encryption key returned by the getEncryptionKey() method.
  • Instead, each time the user runs the application and attempts to access the database, call the getEncryptionKey() method to regenerate the encryption key.

For more information about data security, and an explanation of the security techniques used in the EncryptionKeyGenerator class, see "Example: Generating and using an encryption key" in the guide "Developing Adobe AIR Applications with Flex."

參數

password:String — The password to use to generate the encryption key.
 
overrideSaltELSKey:String (default = null) — The EncryptionKeyGenerator creates and stores a random value (known as a salt) as part of the process of generating the encryption key. The first time an application calls the getEncryptionKey() method, the salt value is created and stored in the AIR application's encrypted local store (ELS). From then on, the salt value is loaded from the ELS.

If you wish to provide a custom String ELS key for storing the salt value, specify a value for the overrideSaltELSKey parameter. If the parameter is null (the default) a default key name is used.

傳回值
ByteArray — The generated encryption key, a 16-byte ByteArray object.

擲回值
ArgumentError — If the specified password is not a "strong" password according to the criteria explained in the validateStrongPassword() method description
 
ArgumentError — If a non-null value is specified for the overrideSaltELSKey parameter, and the value is an empty String ("")

validateStrongPassword

()方法 
public function validateStrongPassword(password:String):Boolean

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
執行階段版本: Flash Player 9, AIR 1.1

Checks a password and returns a value indicating whether the password is a "strong" password. The criteria for a strong password are:

  • Minimum 8 characters
  • Maxmium 32 characters
  • Contains at least one lowercase letter
  • Contains at least one uppercase letter
  • Contains at least one number or symbol character

參數

password:String — The password to check

傳回值
Boolean — A value indicating whether the password is a strong password (true) or not (false).
常數詳細資訊

ENCRYPTED_DB_PASSWORD_ERROR_ID

常數
public static const ENCRYPTED_DB_PASSWORD_ERROR_ID:uint = 3138

語言版本: ActionScript 3.0
產品版本: Adobe Digital Enterprise Platform Data Services for Java EE 3.1
執行階段版本: Flash Player 9, AIR 1.1

This constant matches the error ID (3138) of the SQLError error that occurs when code that is attempting to open an encrypted database provides the wrong encryption key.





[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。