Examples of ValidateRequestType


Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

    private static final Logger LOG = LoggerFactory.getLogger(ValidatorTest.class);

    @Test
    public void testRootCertIsValid() throws CertificateException {
        X509Certificate rootCertificate = readCertificate("trusted_cas/root.cer");
        ValidateRequestType request = prepareValidateXKMSRequest(rootCertificate);
        StatusType result = doValidate(request);

        Assert.assertEquals(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALID, result.getStatusValue());
        Assert.assertFalse(result.getValidReason().isEmpty());
        Assert.assertEquals(ReasonEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALIDITY_INTERVAL.value(), result
View Full Code Here

Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

    }

    @Test
    public void testAliceSignedByRootIsValid() throws JAXBException, CertificateException {
        X509Certificate aliceCertificate = readCertificate("cas/alice.cer");
        ValidateRequestType request = prepareValidateXKMSRequest(aliceCertificate);
        StatusType result = doValidate(request);

        Assert.assertEquals(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALID, result.getStatusValue());
        Assert.assertFalse(result.getValidReason().isEmpty());
        Assert.assertEquals(ReasonEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALIDITY_INTERVAL.value(), result
View Full Code Here

Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

    }

    @Test
    public void testDaveSignedByAliceSginedByRootIsValid() throws JAXBException, CertificateException {
        X509Certificate daveCertificate = readCertificate("dave.cer");
        ValidateRequestType request = prepareValidateXKMSRequest(daveCertificate);
        StatusType result = doValidate(request);

        Assert.assertEquals(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALID, result.getStatusValue());
        Assert.assertFalse(result.getValidReason().isEmpty());
        Assert.assertEquals(ReasonEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALIDITY_INTERVAL.value(), result
View Full Code Here

Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

    }

    @Test
    public void testSelfSignedCertOscarIsNotValid() throws JAXBException, CertificateException {
        X509Certificate oscarCertificate = readCertificate("oscar.cer");
        ValidateRequestType request = prepareValidateXKMSRequest(oscarCertificate);
        StatusType result = doValidate(request);

        Assert.assertEquals(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_INVALID, result.getStatusValue());
        Assert.assertFalse(result.getInvalidReason().isEmpty());
        Assert.assertEquals(ReasonEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_ISSUER_TRUST.value(), result
View Full Code Here

Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

    }

    @Test
    public void testExpiredCertIsNotValid() throws CertificateException {
        X509Certificate expiredCertificate = readCertificate("expired.cer");
        ValidateRequestType request = prepareValidateXKMSRequest(expiredCertificate);
        StatusType result = doValidate(request);

        Assert.assertEquals(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_INVALID, result.getStatusValue());
        Assert.assertFalse(result.getInvalidReason().isEmpty());
        Assert.assertEquals(ReasonEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALIDITY_INTERVAL.value(), result
View Full Code Here

Examples of org.apache.cxf.xkms.model.xkms.ValidateRequestType

        keyInfoType.getContent().add(x509Data);

        QueryKeyBindingType queryKeyBindingType = XKMS_OF.createQueryKeyBindingType();
        queryKeyBindingType.setKeyInfo(keyInfoType);

        ValidateRequestType validateRequestType = XKMS_OF.createValidateRequestType();
        setGenericRequestParams(validateRequestType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);
        // temporary
        validateRequestType.setId(cert.getSubjectDN().toString());
        return validateRequestType;
    }
View Full Code Here

Examples of org.w3._2002._03.xkms_.ValidateRequestType

           
            String reqId = genId();
           
            List keyBindings = new ArrayList();
            if(validate){
              ValidateRequestType validationRequestType = xKMSObjectFactory.createValidateRequestType();
              validationRequestType.setId(reqId);
                Iterator iter = respondWith.iterator();
                while(iter.hasNext()){
                  validationRequestType.getRespondWith().add((String) iter.next());
                }
                validationRequestType.setQueryKeyBinding(queryKeyBindingType);
                getPrintStream().println("Sending validation request with id " + reqId + " to XKMS Service");
                if (clientCert == null) {
                    log.info("Client cert was not found and will not be used.");
                }
                ValidateResultType validateResult = getXKMSInvoker().validate(validationRequestType, clientCert, privateKey);               
View Full Code Here

Examples of org.w3._2002._03.xkms_.ValidateRequestType

    public void test01ClientSignature() throws Exception {
      log.trace(">test01ClientSignature");
        KeyStore clientKeyStore = Constants.getUserKeyStore();

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        String alias = "TEST";
        java.security.cert.X509Certificate pkCert = (java.security.cert.X509Certificate) clientKeyStore.getCertificate(alias);
View Full Code Here

Examples of org.w3._2002._03.xkms_.ValidateRequestType

        }

        XKMSInvoker xKMSInvoker = new XKMSInvoker(SERVICE_URL, trustcol);

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        Document doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(validateRequest, doc);
View Full Code Here

Examples of org.w3._2002._03.xkms_.ValidateRequestType

        }

        XKMSInvoker xKMSInvoker = new XKMSInvoker(SERVICE_URL, trustcol);

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("201");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

        validateRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
        validateRequestType.setQueryKeyBinding(queryKeyBindingType);

        JAXBElement<ValidateRequestType> validateRequest = xKMSObjectFactory.createValidateRequest(validateRequestType);

        Document doc = dbf.newDocumentBuilder().newDocument();
        marshaller.marshal(validateRequest, doc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.