Freigeben über


X509CertSelector Class

Definition

A CertSelector that selects X509Certificates that match all specified criteria.

[Android.Runtime.Register("java/security/cert/X509CertSelector", DoNotGenerateAcw=true)]
public class X509CertSelector : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Security.Cert.ICertSelector
[<Android.Runtime.Register("java/security/cert/X509CertSelector", DoNotGenerateAcw=true)>]
type X509CertSelector = class
    inherit Object
    interface ICertSelector
    interface ICloneable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
X509CertSelector
Attributes
Implements

Remarks

A CertSelector that selects X509Certificates that match all specified criteria. This class is particularly useful when selecting certificates from a CertStore to build a PKIX-compliant certification path.

When first constructed, an X509CertSelector has no criteria enabled and each of the get methods return a default value (null, or -1 for the #getBasicConstraints getBasicConstraints method). Therefore, the #match match method would return true for any X509Certificate. Typically, several criteria are enabled (by calling #setIssuer setIssuer or #setKeyUsage setKeyUsage, for instance) and then the X509CertSelector is passed to CertStore#getCertificates CertStore.getCertificates or some similar method.

Several criteria can be enabled (by calling #setIssuer setIssuer and #setSerialNumber setSerialNumber, for example) such that the match method usually uniquely matches a single X509Certificate. We say usually, since it is possible for two issuing CAs to have the same distinguished name and each issue a certificate with the same serial number. Other unique combinations include the issuer, subject, subjectKeyIdentifier and/or the subjectPublicKey criteria.

Please refer to RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile for definitions of the X.509 certificate extensions mentioned below.

<b>Concurrent Access</b>

Unless otherwise specified, the methods defined in this class are not thread-safe. Multiple threads that need to access a single object concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating separate objects need not synchronize.

Added in 1.4.

Java documentation for java.security.cert.X509CertSelector.

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.

Constructors

X509CertSelector()

Creates an X509CertSelector.

X509CertSelector(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

BasicConstraints

Returns the basic constraints constraint. -or- Sets the basic constraints constraint.

Certificate

Returns the certificateEquals criterion. -or- Sets the certificateEquals criterion.

CertificateValid

Returns the certificateValid criterion. -or- Sets the certificateValid criterion.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ExtendedKeyUsage

Returns the extendedKeyUsage criterion. -or- Sets the extendedKeyUsage criterion.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Issuer

Returns the issuer criterion as an X500Principal. -or- Sets the issuer criterion.

IssuerAsString

<strong>Denigrated</strong>, use #getIssuer() or #getIssuerAsBytes() instead.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MatchAllSubjectAltNames

Indicates if the X509Certificate must contain all or at least one of the subjectAlternativeNames specified in the #setSubjectAlternativeNames setSubjectAlternativeNames or #addSubjectAlternativeName addSubjectAlternativeName methods. -or- Enables/disables matching all of the subjectAlternativeNames specified in the #setSubjectAlternativeNames setSubjectAlternativeNames or #addSubjectAlternativeName addSubjectAlternativeName methods.

PathToNames

Returns a copy of the pathToNames criterion. -or- Sets the pathToNames criterion.

PeerReference (Inherited from Object)
Policy

Returns the policy criterion. -or- Sets the policy constraint.

PrivateKeyValid

Returns the privateKeyValid criterion. -or- Sets the privateKeyValid criterion.

SerialNumber

Returns the serialNumber criterion. -or- Sets the serialNumber criterion.

Subject

Returns the subject criterion as an X500Principal. -or- Sets the subject criterion.

SubjectAlternativeNames

Returns a copy of the subjectAlternativeNames criterion. -or- Sets the subjectAlternativeNames criterion.

SubjectAsString

<strong>Denigrated</strong>, use #getSubject() or #getSubjectAsBytes() instead.

SubjectPublicKey

Returns the subjectPublicKey criterion. -or- Sets the subjectPublicKey criterion.

SubjectPublicKeyAlgID

Returns the subjectPublicKeyAlgID criterion. -or- Sets the subjectPublicKeyAlgID criterion.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddPathToName(Int32, Byte[])

Adds a name to the pathToNames criterion.

AddPathToName(Int32, String)

Adds a name to the pathToNames criterion.

AddSubjectAlternativeName(Int32, Byte[])

Adds a name to the subjectAlternativeNames criterion.

AddSubjectAlternativeName(Int32, String)

Adds a name to the subjectAlternativeNames criterion.

Clone()

Returns a copy of this object.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetAuthorityKeyIdentifier()

Returns the authorityKeyIdentifier criterion.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetIssuerAsBytes()

Returns the issuer criterion as a byte array.

GetKeyUsage()

Returns the keyUsage criterion.

GetNameConstraints()

Returns the name constraints criterion.

GetSubjectAsBytes()

Returns the subject criterion as a byte array.

GetSubjectKeyIdentifier()

Returns the subjectKeyIdentifier criterion.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Match(Certificate)

Decides whether a Certificate should be selected.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetAuthorityKeyIdentifier(Byte[])

Sets the authorityKeyIdentifier criterion.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetIssuer(Byte[])

Sets the issuer criterion.

SetIssuer(String)

<strong>Denigrated</strong>, use #setIssuer(X500Principal) or #setIssuer(byte[]) instead.

SetKeyUsage(Boolean[])

Sets the keyUsage criterion.

SetNameConstraints(Byte[])

Sets the name constraints criterion.

SetSubject(Byte[])

Sets the subject criterion.

SetSubject(String)

<strong>Denigrated</strong>, use #setSubject(X500Principal) or #setSubject(byte[]) instead.

SetSubjectKeyIdentifier(Byte[])

Sets the subjectKeyIdentifier criterion.

SetSubjectPublicKey(Byte[])

Sets the subjectPublicKey criterion.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to