Search in sources :

Example 6 with ExtKeyUsageControl

use of org.xipki.ca.api.profile.x509.ExtKeyUsageControl in project xipki by xipki.

the class XmlX509CertprofileUtil method buildExtKeyUsageOptions.

// method buildKeyUsageOptions
public static Set<ExtKeyUsageControl> buildExtKeyUsageOptions(ExtendedKeyUsage extConf) {
    ParamUtil.requireNonNull("extConf", extConf);
    List<Usage> usages = extConf.getUsage();
    Set<ExtKeyUsageControl> controls = new HashSet<>();
    for (Usage m : usages) {
        ExtKeyUsageControl usage = new ExtKeyUsageControl(new ASN1ObjectIdentifier(m.getValue()), m.isRequired());
        controls.add(usage);
    }
    return Collections.unmodifiableSet(controls);
}
Also used : ExtendedKeyUsage(org.xipki.ca.certprofile.x509.jaxb.ExtendedKeyUsage) Usage(org.xipki.ca.certprofile.x509.jaxb.ExtendedKeyUsage.Usage) KeyUsage(org.xipki.security.KeyUsage) ExtKeyUsageControl(org.xipki.ca.api.profile.x509.ExtKeyUsageControl) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier) HashSet(java.util.HashSet)

Aggregations

ExtKeyUsageControl (org.xipki.ca.api.profile.x509.ExtKeyUsageControl)6 HashSet (java.util.HashSet)5 Extension (org.bouncycastle.asn1.x509.Extension)4 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)3 ExtendedKeyUsage (org.bouncycastle.asn1.x509.ExtendedKeyUsage)2 ExtensionControl (org.xipki.ca.api.profile.ExtensionControl)2 KeyUsageControl (org.xipki.ca.api.profile.x509.KeyUsageControl)2 ExtensionExistence (org.xipki.security.ExtensionExistence)2 KeyUsage (org.xipki.security.KeyUsage)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)1 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)1 ASN1String (org.bouncycastle.asn1.ASN1String)1 DERBMPString (org.bouncycastle.asn1.DERBMPString)1 DERIA5String (org.bouncycastle.asn1.DERIA5String)1 DERNull (org.bouncycastle.asn1.DERNull)1 DEROctetString (org.bouncycastle.asn1.DEROctetString)1 DERPrintableString (org.bouncycastle.asn1.DERPrintableString)1 DERT61String (org.bouncycastle.asn1.DERT61String)1