Compartilhar via


KeyStore.GetCertificate(String) Method

Definition

Returns the certificate associated with the given alias.

[Android.Runtime.Register("getCertificate", "(Ljava/lang/String;)Ljava/security/cert/Certificate;", "")]
public Java.Security.Cert.Certificate? GetCertificate (string? alias);
[<Android.Runtime.Register("getCertificate", "(Ljava/lang/String;)Ljava/security/cert/Certificate;", "")>]
member this.GetCertificate : string -> Java.Security.Cert.Certificate

Parameters

alias
String

the alias name

Returns

the certificate, or null if the given alias does not exist or does not contain a certificate.

Attributes

Exceptions

if this KeyStore is not initialized.

Remarks

Returns the certificate associated with the given alias.

If the given alias name identifies an entry created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry, then the trusted certificate contained in that entry is returned.

If the given alias name identifies an entry created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry, then the first element of the certificate chain in that entry is returned.

Java documentation for java.security.KeyStore.getCertificate(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