use of org.xipki.ca.api.profile.ExtensionControl in project xipki by xipki.
the class XmlX509CertprofileUtil method buildExtensionControls.
// method buildKeyAlgorithms
public static Map<ASN1ObjectIdentifier, ExtensionControl> buildExtensionControls(ExtensionsType extensionsType) throws CertprofileException {
ParamUtil.requireNonNull("extensionsType", extensionsType);
// Extension controls
Map<ASN1ObjectIdentifier, ExtensionControl> controls = new HashMap<>();
for (ExtensionType m : extensionsType.getExtension()) {
ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier(m.getType().getValue());
if (controls.containsKey(oid)) {
throw new CertprofileException("duplicated definition of extension " + oid.getId());
}
ExtensionControl ctrl = new ExtensionControl(m.isCritical(), m.isRequired(), m.isPermittedInRequest());
controls.put(oid, ctrl);
}
return Collections.unmodifiableMap(controls);
}
Aggregations