Search in sources :

Example 16 with ExtensionsType

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

Example 17 with ExtensionsType

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

Example 18 with ExtensionsType

use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.

the class XmlX509Certprofile method initAuthorityKeyIdentifier.

private void initAuthorityKeyIdentifier(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
    ASN1ObjectIdentifier type = Extension.authorityKeyIdentifier;
    if (!extensionControls.containsKey(type)) {
        return;
    }
    extnIds.remove(type);
    AuthorityKeyIdentifier extConf = (AuthorityKeyIdentifier) getExtensionValue(type, extensionsType, AuthorityKeyIdentifier.class);
    if (extConf == null) {
        return;
    }
    this.includeIssuerAndSerialInAki = extConf.isIncludeIssuerAndSerial();
}
Also used : AuthorityKeyIdentifier(org.xipki.ca.certprofile.x509.jaxb.AuthorityKeyIdentifier) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Example 19 with ExtensionsType

use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.

the class XmlX509Certprofile method initBiometricInfo.

private void initBiometricInfo(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
    ASN1ObjectIdentifier type = Extension.biometricInfo;
    if (!extensionControls.containsKey(type)) {
        return;
    }
    extnIds.remove(type);
    BiometricInfo extConf = (BiometricInfo) getExtensionValue(type, extensionsType, BiometricInfo.class);
    if (extConf == null) {
        return;
    }
    try {
        this.biometricInfo = new BiometricInfoOption(extConf);
    } catch (NoSuchAlgorithmException ex) {
        throw new CertprofileException("NoSuchAlgorithmException: " + ex.getMessage());
    }
}
Also used : BiometricInfo(org.xipki.ca.certprofile.x509.jaxb.BiometricInfo) CertprofileException(org.xipki.ca.api.profile.CertprofileException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Example 20 with ExtensionsType

use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType in project xipki by xipki.

the class XmlX509Certprofile method initBasicConstraints.

private void initBasicConstraints(Set<ASN1ObjectIdentifier> extnIds, ExtensionsType extensionsType) throws CertprofileException {
    ASN1ObjectIdentifier type = Extension.basicConstraints;
    if (!extensionControls.containsKey(type)) {
        return;
    }
    extnIds.remove(type);
    BasicConstraints extConf = (BasicConstraints) getExtensionValue(type, extensionsType, BasicConstraints.class);
    if (extConf == null) {
        return;
    }
    this.pathLen = extConf.getPathLen();
}
Also used : BasicConstraints(org.xipki.ca.certprofile.x509.jaxb.BasicConstraints) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Aggregations

ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)39 ExtensionType (org.xipki.ca.certprofile.x509.jaxb.ExtensionType)20 ExtensionsType (org.xipki.ca.certprofile.x509.jaxb.ExtensionsType)18 Subject (org.xipki.ca.certprofile.x509.jaxb.X509ProfileType.Subject)18 RdnType (org.xipki.ca.certprofile.x509.jaxb.RdnType)17 X509ProfileType (org.xipki.ca.certprofile.x509.jaxb.X509ProfileType)17 ExtensionValueType (org.xipki.ca.certprofile.x509.jaxb.ExtensionValueType)16 KeyUsageEnum (org.xipki.ca.certprofile.x509.jaxb.KeyUsageEnum)16 TlsExtensionType (org.xipki.security.TlsExtensionType)16 ExtensionValue (org.xipki.ca.api.profile.ExtensionValue)13 CertprofileException (org.xipki.ca.api.profile.CertprofileException)9 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)8 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 DERSequence (org.bouncycastle.asn1.DERSequence)5 SubjectAltName (org.xipki.ca.certprofile.x509.jaxb.SubjectAltName)5 ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)4 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)4 ASN1StreamParser (org.bouncycastle.asn1.ASN1StreamParser)4 AuthorityInfoAccess (org.xipki.ca.certprofile.x509.jaxb.AuthorityInfoAccess)4