@Override public String[] getCriticalExtensionOID() { ASN1ObjectIdentifier[] asnoids = this.extensions.getCriticalExtensionOIDs(); return toStringArray(asnoids); }
/** * Given an extensions container and an OID, extract the value and * criticality flag and return the values in a map. If the extension is not * found then null is returned. * * @param exts The Bouncy Castle extensions container. * @param oid The OID of the extension to find. * @return A map * @throws IOException */ private static Map<String, Object> makeExtensionMap(Extensions exts, ASN1ObjectIdentifier oid) throws IOException { boolean critical = Arrays.asList(exts.getCriticalExtensionOIDs()).contains(oid); return makeExtensionMap(exts, oid, critical); }
/** * Given an extensions container and an OID, extract the value and * criticality flag and return the values in a map. If the extension is not * found then null is returned. * * @param exts The Bouncy Castle extensions container. * @param oid The OID of the extension to find. * @return A map * @throws IOException */ private static Map<String, Object> makeExtensionMap(Extensions exts, ASN1ObjectIdentifier oid) throws IOException { boolean critical = Arrays.asList(exts.getCriticalExtensionOIDs()).contains(oid); return makeExtensionMap(exts, oid, critical); }
/** * Given a Bouncy Castle Extensions container, return a list of maps * representing all the X509 extensions embedded in the certificate. * * @param exts A Bouncy Castle Extensions container object. * @return A list of maps describing each extensions in the provided * certificate. * @throws IOException */ private static List<Map<String, Object>> getExtensionList(Extensions exts) throws IOException { List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>(); for (ASN1ObjectIdentifier oid : exts.getCriticalExtensionOIDs()) { ret.add(makeExtensionMap(exts, oid, true)); } for (ASN1ObjectIdentifier oid : exts.getNonCriticalExtensionOIDs()) { ret.add(makeExtensionMap(exts, oid, false)); } return ret; }
/** * Given a Bouncy Castle Extensions container, return a list of maps * representing all the X509 extensions embedded in the certificate. * * @param exts A Bouncy Castle Extensions container object. * @return A list of maps describing each extensions in the provided * certificate. * @throws IOException */ private static List<Map<String, Object>> getExtensionList(Extensions exts) throws IOException { List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>(); for (ASN1ObjectIdentifier oid : exts.getCriticalExtensionOIDs()) { ret.add(makeExtensionMap(exts, oid, true)); } for (ASN1ObjectIdentifier oid : exts.getNonCriticalExtensionOIDs()) { ret.add(makeExtensionMap(exts, oid, false)); } return ret; }
for (ASN1ObjectIdentifier oid : bcExtensions.getCriticalExtensionOIDs()) { certBuilder.addExtension(oid, true, bcExtensions.getExtension(oid).getParsedValue());
for (ASN1ObjectIdentifier oid : bcExtensions.getCriticalExtensionOIDs()) { certGen.addExtension(oid.getId(), true, bcExtensions.getExtension(oid).getExtnValue().getOctets());
ASN1ObjectIdentifier[] oids = exts.getCriticalExtensionOIDs(); if (oids != null) { for (ASN1ObjectIdentifier oid : oids) {