use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initAdditionalInformation.
private void initAdditionalInformation(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = ObjectIdentifiers.id_extension_additionalInformation;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
AdditionalInformation extConf = (AdditionalInformation) getExtensionValue(type, extensionsType, AdditionalInformation.class);
if (extConf == null) {
return;
}
DirectoryStringType stringType = XmlX509CertprofileUtil.convertDirectoryStringType(extConf.getType());
ASN1Encodable extValue = stringType.createDirectoryString(extConf.getText());
additionalInformation = new ExtensionValue(extensionControls.get(type).isCritical(), extValue);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initPolicyConstraints.
private void initPolicyConstraints(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.policyConstraints;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
PolicyConstraints extConf = (PolicyConstraints) getExtensionValue(type, extensionsType, PolicyConstraints.class);
if (extConf == null) {
return;
}
ASN1Sequence value = XmlX509CertprofileUtil.buildPolicyConstrains(extConf);
this.policyConstraints = new ExtensionValue(extensionControls.get(type).isCritical(), value);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initCertificatePolicies.
private void initCertificatePolicies(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.certificatePolicies;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
CertificatePolicies extConf = (CertificatePolicies) getExtensionValue(type, extensionsType, CertificatePolicies.class);
if (extConf == null) {
return;
}
List<CertificatePolicyInformation> policyInfos = XmlX509CertprofileUtil.buildCertificatePolicies(extConf);
org.bouncycastle.asn1.x509.CertificatePolicies value = XmlX509CertprofileUtil.createCertificatePolicies(policyInfos);
this.certificatePolicies = new ExtensionValue(extensionControls.get(type).isCritical(), value);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initNameConstraints.
private void initNameConstraints(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.nameConstraints;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
NameConstraints extConf = (NameConstraints) getExtensionValue(type, extensionsType, NameConstraints.class);
if (extConf == null) {
return;
}
org.bouncycastle.asn1.x509.NameConstraints value = XmlX509CertprofileUtil.buildNameConstrains(extConf);
this.nameConstraints = new ExtensionValue(extensionControls.get(type).isCritical(), value);
}
use of org.xipki.ca.api.profile.ExtensionValue in project xipki by xipki.
the class XmlX509Certprofile method initTlsFeature.
private void initTlsFeature(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = ObjectIdentifiers.id_pe_tlsfeature;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
TlsFeature extConf = (TlsFeature) getExtensionValue(type, extensionsType, TlsFeature.class);
if (extConf == null) {
return;
}
List<Integer> features = new ArrayList<>(extConf.getFeature().size());
for (IntWithDescType m : extConf.getFeature()) {
int value = m.getValue();
if (value < 0 || value > 65535) {
throw new CertprofileException("invalid TLS feature (extensionType) " + value);
}
features.add(value);
}
Collections.sort(features);
ASN1EncodableVector vec = new ASN1EncodableVector();
for (Integer m : features) {
vec.add(new ASN1Integer(m));
}
ASN1Encodable extValue = new DERSequence(vec);
tlsFeature = new ExtensionValue(extensionControls.get(type).isCritical(), extValue);
}
Aggregations