use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.
the class XmlX509Certprofile method initKeyUsage.
private void initKeyUsage(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.keyUsage;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
KeyUsage extConf = (KeyUsage) getExtensionValue(type, extensionsType, KeyUsage.class);
if (extConf == null) {
return;
}
this.keyusages = XmlX509CertprofileUtil.buildKeyUsageOptions(extConf);
}
use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType 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.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.
the class XmlX509Certprofile method initPrivateKeyUsagePeriod.
private void initPrivateKeyUsagePeriod(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
ASN1ObjectIdentifier type = Extension.privateKeyUsagePeriod;
if (!extensionControls.containsKey(type)) {
return;
}
extnIds.remove(type);
PrivateKeyUsagePeriod extConf = (PrivateKeyUsagePeriod) getExtensionValue(type, extensionsType, PrivateKeyUsagePeriod.class);
if (extConf == null) {
return;
}
privateKeyUsagePeriod = CertValidity.getInstance(extConf.getValidity());
}
use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.
the class XmlX509Certprofile method initSubjectToSubjectAltNames.
private void initSubjectToSubjectAltNames(ExtensionsType extensionsType) throws CertprofileException {
SubjectToSubjectAltNamesType s2sType = extensionsType.getSubjectToSubjectAltNames();
if (s2sType == null) {
return;
}
subjectToSubjectAltNameModes = new HashMap<>();
for (SubjectToSubjectAltNameType m : s2sType.getSubjectToSubjectAltName()) {
Target target = m.getTarget();
GeneralNameTag nameTag = null;
if (target.getDirectoryName() != null) {
nameTag = GeneralNameTag.directoryName;
} else if (target.getDnsName() != null) {
nameTag = GeneralNameTag.dNSName;
} else if (target.getIpAddress() != null) {
nameTag = GeneralNameTag.iPAddress;
} else if (target.getRfc822Name() != null) {
nameTag = GeneralNameTag.rfc822Name;
} else if (target.getUniformResourceIdentifier() != null) {
nameTag = GeneralNameTag.uniformResourceIdentifier;
} else if (target.getRegisteredID() != null) {
nameTag = GeneralNameTag.registeredID;
} else {
throw new RuntimeException("should not reach here, unknown SubjectToSubjectAltName target");
}
subjectToSubjectAltNameModes.put(new ASN1ObjectIdentifier(m.getSource().getValue()), nameTag);
}
}
use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType 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);
}
Aggregations