語言

KeyChain.IsBoundKeyAlgorithm(String) 方法

定義

警告

deprecated

如果目前裝置true在匯入或生成後綁定了任何KeyChain給定PrivateKey的東西,則會返回algorithm。

[Android.Runtime.Register("isBoundKeyAlgorithm", "(Ljava/lang/String;)Z", "")]
[System.Obsolete("deprecated")]
public static bool IsBoundKeyAlgorithm(string algorithm);
[<Android.Runtime.Register("isBoundKeyAlgorithm", "(Ljava/lang/String;)Z", "")>]
[<System.Obsolete("deprecated")>]
static member IsBoundKeyAlgorithm : string -> bool

參數

algorithm
String

傳回

屬性

備註

如果目前裝置true在匯入或生成後綁定了任何KeyChain給定PrivateKey的東西,則會返回algorithm。 這可以用來判斷是否有特殊硬體支援,能將金鑰綁定到裝置,使其無法匯出。

此會員已被棄用。 金鑰是否綁定在安全硬體,只有在金鑰匯入後才會知道。 要知道答案,請使用: <pre>PrivateKey = ...;// KeyChain 私鑰

KeyFactory keyFactory keyFactory = KeyFactory.getInstance(key.getAlgorithm(), “AndroidKeyStore”);KeyInfo keyInfo = keyFactory.getKeySpec(key, KeyInfo.class);if (keyInfo.isInsideSecureHardware()) { // 金鑰綁定在此 Android 的安全硬體上}</pre>

Java 文件 android.security.KeyChain.isBoundKeyAlgorithm(java.lang.String)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於