X509Certificate Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Abstract class for X.
[Android.Runtime.Register("java/security/cert/X509Certificate", DoNotGenerateAcw=true)]
public abstract class X509Certificate : Java.Security.Cert.Certificate, IDisposable, Java.Interop.IJavaPeerable, Java.Security.Cert.IX509Extension
[<Android.Runtime.Register("java/security/cert/X509Certificate", DoNotGenerateAcw=true)>]
type X509Certificate = class
inherit Certificate
interface IX509Extension
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Remarks
Abstract class for X.509 certificates. This provides a standard way to access all the attributes of an X.509 certificate.
In June of 1996, the basic X.509 v3 format was completed by ISO/IEC and ANSI X9, which is described below in ASN.1:
Certificate ::= SEQUENCE {
tbsCertificate TBSCertificate,
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING }
These certificates are widely used to support authentication and other functionality in Internet security systems. Common applications include Privacy Enhanced Mail (PEM), Transport Layer Security (SSL), code signing for trusted software distribution, and Secure Electronic Transactions (SET).
These certificates are managed and vouched for by <em>Certificate Authorities</em> (CAs). CAs are services which create certificates by placing data in the X.509 standard format and then digitally signing that data. CAs act as trusted third parties, making introductions between principals who have no direct knowledge of each other. CA certificates are either signed by themselves, or by some other CA such as a "root" CA.
More information can be found in RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile.
The ASN.1 definition of tbsCertificate
is:
TBSCertificate ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier,
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version must be v2 or v3
subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
-- If present, version must be v2 or v3
extensions [3] EXPLICIT Extensions OPTIONAL
-- If present, version must be v3
}
Certificates are instantiated using a certificate factory. The following is an example of how to instantiate an X.509 certificate:
try (InputStream inStream = new FileInputStream("fileName-of-cert")) {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);
}
Java documentation for java.security.cert.X509Certificate
.
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
X509Certificate() |
Constructor for X. |
X509Certificate(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Properties
BasicConstraints |
Returns the path length of the certificate constraints from the |
Class |
Returns the runtime class of this |
CriticalExtensionOIDs | |
ExtendedKeyUsage |
Gets an unmodifiable list of Strings representing the OBJECT
IDENTIFIERs of the |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
HasUnsupportedCriticalExtension | |
IssuerAlternativeNames |
Gets an immutable collection of issuer alternative names from the
|
IssuerDN |
Returns the |
IssuerX500Principal |
Returns the issuer (issuer distinguished name) value from the
certificate as an |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
NonCriticalExtensionOIDs | |
NotAfter |
Returns the |
NotBefore |
Returns the |
PeerReference | (Inherited from Object) |
PublicKey |
Returns the public key corresponding to this certificate. (Inherited from Certificate) |
SerialNumber |
Returns the |
SigAlgName |
Returns the name of the algorithm for the certificate signature. |
SigAlgOID |
Returns the OID of the signature algorithm from the certificate. |
SubjectAlternativeNames |
Gets an immutable collection of subject alternative names from the
|
SubjectDN |
Returns the |
SubjectX500Principal |
Returns the subject (subject distinguished name) value from the
certificate as an |
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. |
Type |
Returns the type of this certificate. (Inherited from Certificate) |
Version |
Returns the certificates |
Methods
CheckValidity() |
Checks that the certificate is currently valid. |
CheckValidity(Date) |
Checks that the given date is within the certificate's validity period. |
Clone() |
Creates and returns a copy of this object. (Inherited from 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) |
GetEncoded() |
Returns the encoded form of this certificate. (Inherited from Certificate) |
GetExtensionValue(String) |
Gets the DER-encoded OCTET string for the extension value
(<em>extnValue</em>) identified by the passed-in |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetIssuerUniqueID() |
Gets the |
GetKeyUsage() |
Gets a boolean array representing bits of
the |
GetSigAlgParams() |
Gets the DER-encoded signature algorithm parameters from this certificate's signature algorithm. |
GetSignature() |
Gets the |
GetSubjectUniqueID() |
Gets the |
GetTBSCertificate() |
Gets the DER-encoded certificate information, the
|
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) |
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) |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of this certificate. (Inherited from Certificate) |
UnregisterFromRuntime() | (Inherited from Object) |
Verify(IPublicKey, Provider) |
Verifies that this certificate was signed using the private key that corresponds to the specified public key. |
Verify(IPublicKey, String) |
Verifies that this certificate was signed using the private key that corresponds to the specified public key. (Inherited from Certificate) |
Verify(IPublicKey) |
Verifies that this certificate was signed using the private key that corresponds to the specified public key. (Inherited from Certificate) |
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, 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) |
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) |
WriteReplace() |
Replace the Certificate to be serialized. (Inherited from Certificate) |
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) |