Search in sources :

Example 1 with DirectoryStringType

use of org.xipki.ca.api.profile.DirectoryStringType 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);
}
Also used : AdditionalInformation(org.xipki.ca.certprofile.x509.jaxb.AdditionalInformation) ExtensionValue(org.xipki.ca.api.profile.ExtensionValue) ASN1Encodable(org.bouncycastle.asn1.ASN1Encodable) DirectoryStringType(org.xipki.ca.api.profile.DirectoryStringType) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Example 2 with DirectoryStringType

use of org.xipki.ca.api.profile.DirectoryStringType in project xipki by xipki.

the class XmlX509Certprofile method initRestriction.

private void initRestriction(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
    ASN1ObjectIdentifier type = ObjectIdentifiers.id_extension_restriction;
    if (!extensionControls.containsKey(type)) {
        return;
    }
    extnIds.remove(type);
    Restriction extConf = (Restriction) getExtensionValue(type, extensionsType, Restriction.class);
    if (extConf == null) {
        return;
    }
    DirectoryStringType stringType = XmlX509CertprofileUtil.convertDirectoryStringType(extConf.getType());
    ASN1Encodable extValue = stringType.createDirectoryString(extConf.getText());
    restriction = new ExtensionValue(extensionControls.get(type).isCritical(), extValue);
}
Also used : Restriction(org.xipki.ca.certprofile.x509.jaxb.Restriction) ExtensionValue(org.xipki.ca.api.profile.ExtensionValue) ASN1Encodable(org.bouncycastle.asn1.ASN1Encodable) DirectoryStringType(org.xipki.ca.api.profile.DirectoryStringType) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Aggregations

ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)2 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)2 DirectoryStringType (org.xipki.ca.api.profile.DirectoryStringType)2 ExtensionValue (org.xipki.ca.api.profile.ExtensionValue)2 AdditionalInformation (org.xipki.ca.certprofile.x509.jaxb.AdditionalInformation)1 Restriction (org.xipki.ca.certprofile.x509.jaxb.Restriction)1