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;
}
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);
}
Aggregations