Search in sources :

Example 1 with DNConstraintsType

use of org.apache.cxf.configuration.security.DNConstraintsType in project cxf by apache.

the class HTTPJettyTransportActivator method configureCertConstraints.

private void configureCertConstraints(TLSServerParameters p, String k, String v) {
    k = k.substring("certConstraints.".length());
    CertificateConstraintsType cct = p.getCertConstraints();
    if (cct == null) {
        cct = new CertificateConstraintsType();
        p.setCertConstraints(cct);
    }
    DNConstraintsType dnct = null;
    if (k.startsWith("SubjectDNConstraints.")) {
        dnct = cct.getSubjectDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setSubjectDNConstraints(dnct);
        }
        k = k.substring("SubjectDNConstraints.".length());
    } else if (k.startsWith("IssuerDNConstraints.")) {
        dnct = cct.getIssuerDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setIssuerDNConstraints(dnct);
        }
        k = k.substring("IssuerDNConstraints.".length());
    }
    if (dnct != null) {
        if ("combinator".equals(k)) {
            dnct.setCombinator(CombinatorType.fromValue(v));
        } else if ("RegularExpression".equals(k)) {
            dnct.getRegularExpression().add(k);
        }
    }
}
Also used : DNConstraintsType(org.apache.cxf.configuration.security.DNConstraintsType) CertificateConstraintsType(org.apache.cxf.configuration.security.CertificateConstraintsType)

Example 2 with DNConstraintsType

use of org.apache.cxf.configuration.security.DNConstraintsType in project cxf by apache.

the class HttpConduitConfigApplier method parseCertConstaints.

private void parseCertConstaints(TLSClientParameters p, String k, String v) {
    k = k.substring("certConstraints.".length());
    CertificateConstraintsType cct = p.getCertConstraints();
    if (cct == null) {
        cct = new CertificateConstraintsType();
        p.setCertConstraints(cct);
    }
    DNConstraintsType dnct = null;
    if (k.startsWith("SubjectDNConstraints.")) {
        dnct = cct.getSubjectDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setSubjectDNConstraints(dnct);
        }
        k = k.substring("SubjectDNConstraints.".length());
    } else if (k.startsWith("IssuerDNConstraints.")) {
        dnct = cct.getIssuerDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setIssuerDNConstraints(dnct);
        }
        k = k.substring("IssuerDNConstraints.".length());
    }
    if (dnct != null) {
        if ("combinator".equals(k)) {
            dnct.setCombinator(CombinatorType.fromValue(v));
        } else if ("RegularExpression".equals(k)) {
            dnct.getRegularExpression().add(k);
        }
    }
}
Also used : DNConstraintsType(org.apache.cxf.configuration.security.DNConstraintsType) CertificateConstraintsType(org.apache.cxf.configuration.security.CertificateConstraintsType)

Example 3 with DNConstraintsType

use of org.apache.cxf.configuration.security.DNConstraintsType in project cxf by apache.

the class HTTPUndertowTransportActivator method configureCertConstraints.

private void configureCertConstraints(TLSServerParameters p, String k, String v) {
    k = k.substring("certConstraints.".length());
    CertificateConstraintsType cct = p.getCertConstraints();
    if (cct == null) {
        cct = new CertificateConstraintsType();
        p.setCertConstraints(cct);
    }
    DNConstraintsType dnct = null;
    if (k.startsWith("SubjectDNConstraints.")) {
        dnct = cct.getSubjectDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setSubjectDNConstraints(dnct);
        }
        k = k.substring("SubjectDNConstraints.".length());
    } else if (k.startsWith("IssuerDNConstraints.")) {
        dnct = cct.getIssuerDNConstraints();
        if (dnct == null) {
            dnct = new DNConstraintsType();
            cct.setIssuerDNConstraints(dnct);
        }
        k = k.substring("IssuerDNConstraints.".length());
    }
    if (dnct != null) {
        if ("combinator".equals(k)) {
            dnct.setCombinator(CombinatorType.fromValue(v));
        } else if ("RegularExpression".equals(k)) {
            dnct.getRegularExpression().add(k);
        }
    }
}
Also used : DNConstraintsType(org.apache.cxf.configuration.security.DNConstraintsType) CertificateConstraintsType(org.apache.cxf.configuration.security.CertificateConstraintsType)

Aggregations

CertificateConstraintsType (org.apache.cxf.configuration.security.CertificateConstraintsType)3 DNConstraintsType (org.apache.cxf.configuration.security.DNConstraintsType)3