Search in sources :

Example 1 with PolicyIdMappingType

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

the class ProfileConfCreatorDemo method createPolicyIdMapping.

private static PolicyIdMappingType createPolicyIdMapping(ASN1ObjectIdentifier issuerPolicyId, ASN1ObjectIdentifier subjectPolicyId) {
    PolicyIdMappingType ret = new PolicyIdMappingType();
    ret.setIssuerDomainPolicy(createOidType(issuerPolicyId));
    ret.setSubjectDomainPolicy(createOidType(subjectPolicyId));
    return ret;
}
Also used : PolicyIdMappingType(org.xipki.ca.certprofile.x509.jaxb.PolicyIdMappingType)

Example 2 with PolicyIdMappingType

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

the class XmlX509CertprofileUtil method buildPolicyMappings.

// method buildCertificatePolicies
public static PolicyMappings buildPolicyMappings(org.xipki.ca.certprofile.x509.jaxb.PolicyMappings type) {
    ParamUtil.requireNonNull("type", type);
    List<PolicyIdMappingType> mappings = type.getMapping();
    final int n = mappings.size();
    CertPolicyId[] issuerDomainPolicy = new CertPolicyId[n];
    CertPolicyId[] subjectDomainPolicy = new CertPolicyId[n];
    for (int i = 0; i < n; i++) {
        PolicyIdMappingType mapping = mappings.get(i);
        ASN1ObjectIdentifier oid = new ASN1ObjectIdentifier(mapping.getIssuerDomainPolicy().getValue());
        issuerDomainPolicy[i] = CertPolicyId.getInstance(oid);
        oid = new ASN1ObjectIdentifier(mapping.getSubjectDomainPolicy().getValue());
        subjectDomainPolicy[i] = CertPolicyId.getInstance(oid);
    }
    return new PolicyMappings(issuerDomainPolicy, subjectDomainPolicy);
}
Also used : CertPolicyId(org.bouncycastle.asn1.x509.CertPolicyId) PolicyMappings(org.bouncycastle.asn1.x509.PolicyMappings) PolicyIdMappingType(org.xipki.ca.certprofile.x509.jaxb.PolicyIdMappingType) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Aggregations

PolicyIdMappingType (org.xipki.ca.certprofile.x509.jaxb.PolicyIdMappingType)2 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)1 CertPolicyId (org.bouncycastle.asn1.x509.CertPolicyId)1 PolicyMappings (org.bouncycastle.asn1.x509.PolicyMappings)1