use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initAuthorizationTemplate.
private void initAuthorizationTemplate(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = ObjectIdentifiers.id_xipki_ext_authorizationTemplate;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
AuthorizationTemplate extConf = (AuthorizationTemplate) getExtensionValue(type, extensionsType, AuthorizationTemplate.class);
if (extConf == null) {
return;
}
ASN1EncodableVector vec = new ASN1EncodableVector();
vec.add(new ASN1ObjectIdentifier(extConf.getType().getValue()));
vec.add(new DEROctetString(extConf.getAccessRights().getValue()));
ASN1Encodable extValue = new DERSequence(vec);
authorizationTemplate = new ExtensionValue(extensionControls.get(type).isCritical(), extValue);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initPolicyMappings.
private void initPolicyMappings(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.policyMappings;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
PolicyMappings extConf = (PolicyMappings) getExtensionValue(type, extensionsType, PolicyMappings.class);
if (extConf == null) {
return;
}
org.bouncycastle.asn1.x509.PolicyMappings value = XmlX509CertprofileUtil.buildPolicyMappings(extConf);
this.policyMappings = new ExtensionValue(extensionControls.get(type).isCritical(), value);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initValidityModel.
private void initValidityModel(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = ObjectIdentifiers.id_extension_validityModel;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
ValidityModel extConf = (ValidityModel) getExtensionValue(type, extensionsType, ValidityModel.class);
if (extConf == null) {
return;
}
ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier(extConf.getModelId().getValue());
ASN1Encodable extValue = new DERSequence(oid);
validityModel = new ExtensionValue(extensionControls.get(type).isCritical(), extValue);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initInhibitAnyPolicy.
private void initInhibitAnyPolicy(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.inhibitAnyPolicy;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
InhibitAnyPolicy extConf = (InhibitAnyPolicy) getExtensionValue(type, extensionsType, InhibitAnyPolicy.class);
if (extConf == null) {
return;
}
int skipCerts = extConf.getSkipCerts();
if (skipCerts < 0) {
throw new CertprofileException("negative inhibitAnyPolicy.skipCerts is not allowed: " + skipCerts);
}
ASN1Integer value = new ASN1Integer(BigInteger.valueOf(skipCerts));
this.inhibitAnyPolicy = new ExtensionValue(extensionControls.get(type).isCritical(), value);
}
Aggregations