Search in sources :

Example 1 with TLSClientParametersType

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

the class TLSClientParametersConfig method createTLSClientParameters.

public static Object createTLSClientParameters(String s) {
    StringReader reader = new StringReader(s);
    XMLStreamReader data = StaxUtils.createXMLStreamReader(reader);
    try {
        JAXBElement<TLSClientParametersType> type = JAXBUtils.unmarshall(getContext(), data, TLSClientParametersType.class);
        TLSClientParametersType cpt = type.getValue();
        return createTLSClientParametersFromType(cpt);
    } catch (RuntimeException e) {
        throw e;
    } catch (Exception e) {
        throw new RuntimeException(e);
    } finally {
        try {
            StaxUtils.close(data);
        } catch (XMLStreamException ex) {
            throw new RuntimeException(ex);
        }
    }
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) XMLStreamException(javax.xml.stream.XMLStreamException) StringReader(java.io.StringReader) TLSClientParametersType(org.apache.cxf.configuration.security.TLSClientParametersType) IOException(java.io.IOException) JAXBException(javax.xml.bind.JAXBException) GeneralSecurityException(java.security.GeneralSecurityException) XMLStreamException(javax.xml.stream.XMLStreamException)

Aggregations

IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 GeneralSecurityException (java.security.GeneralSecurityException)1 JAXBException (javax.xml.bind.JAXBException)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1 TLSClientParametersType (org.apache.cxf.configuration.security.TLSClientParametersType)1