KeyStore.GetKey(String, Char[]) Method

Definition

Returns the key associated with the given alias, using the given password to recover it.

[Android.Runtime.Register("getKey", "(Ljava/lang/String;[C)Ljava/security/Key;", "")]
public Java.Security.IKey? GetKey (string? alias, char[]? password);

Parameters

alias
String

the alias name

password
Char[]

the password for recovering the key

Returns

the requested key, or null if the given alias does not exist or does not identify a key-related entry.

Attributes

Exceptions

if this KeyStore is not initialized.

if the algorithm for recovering the key is not available.

if the key can not be recovered.

Remarks

Returns the key associated with the given alias, using the given password to recover it. The key must have been associated with the alias by a call to setKeyEntry, or by a call to setEntry with a PrivateKeyEntry or SecretKeyEntry.

Java documentation for java.security.KeyStore.getKey(java.lang.String, char[]).

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