Search in sources :

Example 16 with ValidateRequestType

use of org.apache.cxf.xkms.model.xkms.ValidateRequestType in project cxf by apache.

the class X509UtilsTest method extractValidatingCertsOK.

@Test
@org.junit.Ignore
public void extractValidatingCertsOK() throws JAXBException {
    InputStream is = this.getClass().getResourceAsStream("/validateRequestOK.xml");
    @SuppressWarnings("unchecked") JAXBElement<ValidateRequestType> request = (JAXBElement<ValidateRequestType>) unmarshaller.unmarshal(is);
    List<X509Certificate> certs = ValidateRequestParser.parse(request.getValue());
    Assert.assertEquals("Exactly one certificate should be found", 1, certs.size());
    Assert.assertEquals("Unexcpected certificate DN", CERT_DN, certs.get(0).getSubjectDN().getName());
}
Also used : InputStream(java.io.InputStream) JAXBElement(javax.xml.bind.JAXBElement) X509Certificate(java.security.cert.X509Certificate) ValidateRequestType(org.apache.cxf.xkms.model.xkms.ValidateRequestType) BasicValidationTest(org.apache.cxf.xkms.x509.validator.BasicValidationTest) Test(org.junit.Test)

Aggregations

ValidateRequestType (org.apache.cxf.xkms.model.xkms.ValidateRequestType)16 Test (org.junit.Test)11 X509Certificate (java.security.cert.X509Certificate)10 BasicIntegrationTest (org.apache.cxf.xkms.itests.BasicIntegrationTest)9 StatusType (org.apache.cxf.xkms.model.xkms.StatusType)9 InputStream (java.io.InputStream)3 CertificateEncodingException (java.security.cert.CertificateEncodingException)3 JAXBElement (javax.xml.bind.JAXBElement)3 QueryKeyBindingType (org.apache.cxf.xkms.model.xkms.QueryKeyBindingType)3 KeyInfoType (org.apache.cxf.xkms.model.xmldsig.KeyInfoType)3 X509DataType (org.apache.cxf.xkms.model.xmldsig.X509DataType)3 BasicValidationTest (org.apache.cxf.xkms.x509.validator.BasicValidationTest)2 XKMSValidateException (org.apache.cxf.xkms.exception.XKMSValidateException)1 ValidateResultType (org.apache.cxf.xkms.model.xkms.ValidateResultType)1