Language

KeyChain.IsBoundKeyAlgorithm(String) Method

Definition

Caution

deprecated

Returns a legacy indication of hardware support for the specified key 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

Parameters

algorithm
String

The key algorithm name for the legacy hardware-support check, such as RSA.

Returns

A legacy indication of hardware support for the algorithm. In the Android 12 (API 31) through Android 17 (API 37) implementations, this method always returns true, regardless of the algorithm. The result does not determine whether an individual key is hardware-backed; inspect that key's KeyInfo instead.

Attributes

Remarks

On Android 4.3 (API 18), this method checks whether the algorithm is supported and whether hardware-backed key storage is available. On Android 4.4 (API 19) through Android 11 (API 30), it checks whether the algorithm is supported and hardware-backed.

This member is deprecated. Whether the key is bound to the secure hardware is known only once the key has been imported. To find out, use: <pre>PrivateKey key = ...; // private key from KeyChain

KeyFactory keyFactory = KeyFactory.getInstance(key.getAlgorithm(), "AndroidKeyStore"); KeyInfo keyInfo = keyFactory.getKeySpec(key, KeyInfo.class); if (keyInfo.isInsideSecureHardware()) { // The key is bound to the secure hardware of this Android}</pre>

Java documentation for android.security.KeyChain.isBoundKeyAlgorithm(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to