public final class PasscodeEncryptionSupport extends Object
使用 Nest 密碼加密配置加密及解密密碼的公用程式方法。
常數摘要
int | kPasscodeEncryptionConfig1_TEST_ONLY | 密碼加密設定 1 (僅供測試) 注意:這項加密設定僅供測試,不提供完整性或機密性。 |
int | kPasscodeEncryptionConfig2 | 密碼加密設定 2 |
欄位摘要
public static final byte[] | kPasscodeEncKeyDiversifier | 用於衍生密碼加密和驗證金鑰的金鑰衍生器。 |
public static final byte[] | kPasscodeFingerprintKeyDiversifier | 用於衍生密碼指紋金鑰的金鑰衍生器。 |
公用建構函式摘要
公用方法摘要
static String |
decryptPasscode(byte[] encryptedPasscode, byte[] encKey, byte[]
authKey, byte[] fingerprintKey)
解密使用 Nest 密碼加密機制加密的密碼。
|
static byte[] |
encryptPasscode(int config, int keyId, long nonce, String passcode,
byte[] encKey, byte[] authKey, byte[] fingerprintKey)
使用 Nest 密碼加密機制加密密碼。
|
static int |
getEncryptedPasscodeConfig(byte[] encryptedPasscode)
從加密的密碼中擷取設定類型。
|
static byte[] |
getEncryptedPasscodeFingerprint(byte[] encryptedPasscode)
從加密的密碼中擷取指紋。
|
static int |
getEncryptedPasscodeKeyId(byte[] encryptedPasscode)
從加密的密碼中擷取金鑰 ID。
|
static long |
getEncryptedPasscodeNonce(byte[] encryptedPasscode)
從加密的密碼中擷取隨機值。
|
static boolean |
isSupportedPasscodeEncryptionConfig(int config)
判斷是否支援指定的密碼加密設定。
|
繼承方法摘要
常數
public static final int kPasscodeEncryptionConfig1_TEST_ONLY
密碼加密設定 1 (僅供測試) 注意:這項加密設定僅供測試,不提供完整性或機密性。設定 1 僅適用於開發版本。
常數值: 1
public static final int kPasscodeEncryptionConfig2
密碼加密設定 2
常數值: 2
欄位
public static final byte[] kPasscodeEncKeyDiversifier
用於衍生密碼加密和驗證金鑰的金鑰衍生器。
public static final byte[] kPasscodeFingerprintKeyDiversifier
用於衍生密碼指紋金鑰的金鑰衍生器。
公用建構函式
public PasscodeEncryptionSupport ()
公用方法
public static String decryptPasscode (byte[] encryptedPasscode, byte[] encKey, byte[] authKey, byte[] fingerprintKey)
解密使用 Nest 密碼加密機制加密的密碼。
參數
encryptedPasscode | |
---|---|
encKey | |
authKey | |
fingerprintKey |
public static byte[] encryptPasscode (int config, int keyId, long nonce, String passcode, byte[] encKey, byte[] authKey, byte[] fingerprintKey)
使用 Nest 密碼加密機制加密密碼。
參數
config | |
---|---|
keyId | |
Nonce | |
通行碼 | |
encKey | |
authKey | |
fingerprintKey |
public static int getEncryptedPasscodeConfig (byte[] encryptedPasscode)
public static byte[] getEncryptedPasscodeFingerprint (byte[] encryptedPasscode)
public static int getEncryptedPasscodeKeyId (byte[] encryptedPasscode)
public static long getEncryptedPasscodeNonce (byte[] encryptedPasscode)
public static boolean isSupportedPasscodeEncryptionConfig (int config)
判斷是否支援指定的密碼加密設定。
參數
config |
---|