Search in sources :

Example 46 with ExtensionsType

use of org.xipki.ca.certprofile.x509.jaxb.ExtensionsType 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

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