Package org.picketlink.identity.federation.core.wstrust.writers

Examples of org.picketlink.identity.federation.core.wstrust.writers.WSTrustRequestWriter


    }

    private DOMSource createSourceFromRequest(RequestSecurityToken request) throws WSTrustException {
        try {
            DOMResult result = new DOMResult(DocumentUtil.createDocument());
            WSTrustRequestWriter writer = new WSTrustRequestWriter(result);
            writer.write(request);
            return new DOMSource(result.getNode());
        } catch (Exception e) {
            throw new WSTrustException(logger.processingError(e));
        }
    }
View Full Code Here


        RequestSecurityToken requestToken = (RequestSecurityToken) parser.parse(configStream);
        assertEquals("http://docs.oasis-open.org/ws-sx/ws-trust/200512/CK/PSHA1", requestToken.getComputedKeyAlgorithm().toASCIIString());
       
        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        byte[] data = baos.toByteArray();
        Logger.getLogger(WSTrustComputedKeyAlgorithmTestCase.class).debug(new String(data));
        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(data));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
View Full Code Here

        SubjectType subject = assertion.getSubject();
        assertEquals("jduke", ((NameIDType) subject.getSubType().getBaseID()).getValue());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        assertEquals(WSTrustConstants.BATCH_ISSUE_REQUEST, rst2.getRequestType().toASCIIString());
        assertEquals("http://www.tokens.org/SpecialToken", rst2.getTokenType().toASCIIString());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestCollection);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        AssertionType assertion = SAMLUtil.fromElement(assertionElement);
        validateAssertion(assertion);

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        assertEquals("ds:" + WSTRequestSecurityTokenParser.KEYVALUE, certEl.getTagName());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        System.out.println(DocumentUtil.asString(doc));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
        assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

    }

    private Source createSourceFromRequest(RequestSecurityToken request) throws Exception {
        // write the request XML to a DOMResult
        DOMResult result = new DOMResult(DocumentUtil.createDocument());
        WSTrustRequestWriter writer = new WSTrustRequestWriter(result);
        writer.write(request);
        return new DOMSource(result.getNode());
    }
View Full Code Here

        assertEquals(WSTrustConstants.BS_TYPE_NONCE, binarySecret.getType());
        assertEquals("M0/7qLpV49c=", new String(binarySecret.getValue()));

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(baos.toByteArray()));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
    }
View Full Code Here

        assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());
        assertEquals(SAMLUtil.SAML2_TOKEN_TYPE, requestToken.getTokenType().toASCIIString());

        // Now for the writing part
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        WSTrustRequestWriter rstWriter = new WSTrustRequestWriter(baos);

        rstWriter.write(requestToken);

        byte[] data = baos.toByteArray();
        Logger.getLogger(WSTrustSecondaryParametersTestCase.class).debug(new String(data));
        Document doc = DocumentUtil.getDocument(new ByteArrayInputStream(data));
        JAXPValidationUtil.validate(DocumentUtil.getNodeAsStream(doc));
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.wstrust.writers.WSTrustRequestWriter

Copyright © 2018 www.massapicom. 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.