int function ( ) { Extension loc0 = getExtensionByOID ( "srini_string" ) ; if ( loc0 == null ) { return - 1 ; } BasicConstraints loc1 = loc0 . getBasicConstraintsValue ( ) ; if ( loc1 == null || ! loc1 . getCa ( ) ) { return - 1 ; } return loc1 . getPathLenConstraint ( ) ; }
returns the value of basic constraints extension oid = 2.5.29.19 . the asn .1 definition of basic constraints extension is : id-ce-basicconstraints object identifier : : = id-ce 19 basicconstraints : : = sequence ca boolean default false , pathlenconstraint integer 0 . . max optional as specified in rfc 3280 concode_field_sep ASN1Type ASN1 concode_elem_sep List<Extension> extensions concode_elem_sep HashMap<String,Extension> oidMap concode_elem_sep List SUPPORTED_CRITICAL concode_elem_sep Set<String> critical concode_elem_sep boolean hasUnsupported concode_elem_sep Set<String> noncritical concode_elem_sep byte[] encoding concode_field_sep Collection getValues concode_elem_sep byte[] getEncoded concode_elem_sep Collection<List<?>> valueOfIssuerAlternativeName concode_elem_sep X500Principal valueOfCertificateIssuerExtension concode_elem_sep void dumpValue concode_elem_sep Set<String> getNonCriticalExtensions concode_elem_sep Object getDecodedObject concode_elem_sep Extension getExtensionByOID concode_elem_sep boolean hasUnsupportedCritical concode_elem_sep void makeOidsLists concode_elem_sep int size concode_elem_sep int hashCode concode_elem_sep boolean equals concode_elem_sep Collection<List<?>> valueOfSubjectAlternativeName concode_elem_sep List<String> valueOfExtendedKeyUsage concode_elem_sep Set<String> getCriticalExtensions concode_elem_sep Collection<List<?>> decodeGeneralNames concode_elem_sep boolean[] valueOfKeyUsage