Search in sources :

Example 26 with CertprofileException

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

the class XmlX509Certprofile method initialize.

// method initialize
public void initialize(X509ProfileType conf) throws CertprofileException {
    ParamUtil.requireNonNull("conf", conf);
    reset();
    try {
        initialize0(conf);
    } catch (RuntimeException ex) {
        LogUtil.error(LOG, ex);
        throw new CertprofileException("caught RuntimeException while initializing certprofile: " + ex.getMessage());
    }
}
Also used : CertprofileException(org.xipki.ca.api.profile.CertprofileException)

Example 27 with CertprofileException

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

Aggregations

CertprofileException (org.xipki.ca.api.profile.CertprofileException)27 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)18 HashMap (java.util.HashMap)8 IOException (java.io.IOException)7 HashSet (java.util.HashSet)7 DERPrintableString (org.bouncycastle.asn1.DERPrintableString)6 DERUTF8String (org.bouncycastle.asn1.DERUTF8String)6 BadCertTemplateException (org.xipki.ca.api.BadCertTemplateException)6 ExtensionValue (org.xipki.ca.api.profile.ExtensionValue)6 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)5 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)5 DERIA5String (org.bouncycastle.asn1.DERIA5String)5 DEROctetString (org.bouncycastle.asn1.DEROctetString)5 DERTaggedObject (org.bouncycastle.asn1.DERTaggedObject)5 DirectoryString (org.bouncycastle.asn1.x500.DirectoryString)5 X500Name (org.bouncycastle.asn1.x500.X500Name)5 CRLDistPoint (org.bouncycastle.asn1.x509.CRLDistPoint)5 BigInteger (java.math.BigInteger)4 ArrayList (java.util.ArrayList)4 LinkedList (java.util.LinkedList)4