Language

IX509Extension.NonCriticalExtensionOIDs Property

Definition

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

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

Property Value

a Set (or an empty Set if none are marked non-critical) of the extension OID strings for extensions that are marked non-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 NON-CRITICAL in the certificate/CRL managed by the object implementing this interface.

CertificateFactory cf = null;
X509CRL crl = null;
try (InputStream inStrm = new FileInputStream("DER-encoded-CRL")) {
    cf = CertificateFactory.getInstance("X.509");
    crl = (X509CRL)cf.generateCRL(inStrm);
}

byte[] certData = <DER-encoded certificate data>
ByteArrayInputStream bais = new ByteArrayInputStream(certData);
X509Certificate cert = (X509Certificate)cf.generateCertificate(bais);
X509CRLEntry badCert =
             crl.getRevokedCertificate(cert.getSerialNumber());

if (badCert != null) {
    Set<String> nonCritSet = badCert.getNonCriticalExtensionOIDs();
    if (nonCritSet != null)
        for (String oid : nonCritSet) {
            System.out.println(oid);
        }
}

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

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