Java.Security.KeyStore.SetKeyEntry Method
Associates the given alias with a key and a certificate chain.

Syntax

[Android.Runtime.Register("setKeyEntry", "(Ljava/lang/String;[B[Ljava/security/cert/Certificate;)V", "")]
public void SetKeyEntry (string alias, byte[] key, Java.Security.Cert.Certificate[] chain)

Parameters

alias
the alias for the key.
key
the key in an encoded format.
chain
the certificate chain.

Exceptions

TypeReason
Java.Security.KeyStoreExceptionif this KeyStore is not initialized or if key is null.
Java.Lang.IllegalArgumentExceptionif key is a PrivateKey and chain does.
Java.Lang.NullPointerExceptionif alias is null.

Remarks

Associates the given alias with a key and a certificate chain.

If the specified alias already exists, it will be reassigned.

If this KeyStore is of type "jks", key must be encoded conform to the PKS#8 standard as an Javax.Crypto.EncryptedPrivateKeyInfo.

[Android Documentation]

Requirements

Namespace: Java.Security
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1