Sdílet prostřednictvím


KeyStore.GetCertificateAlias(Certificate) Method

Definition

Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.

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

Parameters

cert
Certificate

the certificate to match with.

Returns

the alias name of the first entry with a matching certificate, or null if no such entry exists in this keystore.

Attributes

Exceptions

if this KeyStore is not initialized.

Remarks

Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.

This method attempts to match the given certificate with each keystore entry. If the entry being considered was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry, then the given certificate is compared to that entry's certificate.

If the entry being considered was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry, then the given certificate is compared to the first element of that entry's certificate chain.

Java documentation for java.security.KeyStore.getCertificateAlias(java.security.cert.Certificate).

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