Language

IX509Extension.CriticalExtensionOIDs Property

Definition

Returns the set of OIDs of the extension(s) marked as CRITICAL, that this implementation manages.

public System.Collections.Generic.ICollection<string>? CriticalExtensionOIDs { [Android.Runtime.Register("getCriticalExtensionOIDs", "()Ljava/util/Set;", "GetGetCriticalExtensionOIDsHandler:Java.Security.Cert.IX509ExtensionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")] get; }
[<get: Android.Runtime.Register("getCriticalExtensionOIDs", "()Ljava/util/Set;", "GetGetCriticalExtensionOIDsHandler:Java.Security.Cert.IX509ExtensionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
member this.CriticalExtensionOIDs : System.Collections.Generic.ICollection<string>

Property Value

a Set (or an empty Set if none are marked critical) of the extension OID strings for extensions that are marked critical. If there are no extensions present at all, then this method returns null.

Attributes

Remarks

Gets a Set of the OID strings for the extension(s) marked CRITICAL in the certificate/CRL managed by the object implementing this interface.

X509Certificate cert = null;
try (InputStream inStrm = new FileInputStream("DER-encoded-Cert")) {
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    cert = (X509Certificate)cf.generateCertificate(inStrm);
}

Set<String> critSet = cert.getCriticalExtensionOIDs();
if (critSet != null && !critSet.isEmpty()) {
    System.out.println("Set of critical extensions:");
    for (String oid : critSet) {
        System.out.println(oid);
    }
}

Java reference for java.security.cert.X509Extension.getCriticalExtensionOIDs.

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