/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified {@code Result} * . * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustResponseWriter} instance that writes WS-Trust response messages to the specified {@code Result}. * </p> * * @param result the {@code Result} object where the response is to be written. * @throws ProcessingException if an error occurs when creating the {@code XMLStreamWriter} for the specified result. */ public WSTrustResponseWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustResponseWriter} instance that writes WS-Trust response messages to the specified * {@code OutputStream}. * </p> * * @param stream the where the response is to be written. * @throws ProcessingException if an error occurs when creating the {@code XMLStreamWriter} for the specified stream. */ public WSTrustResponseWriter(OutputStream stream) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(stream); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code Result}. * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustRSTWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRSTWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code Result}. * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustRSTWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code Result}. * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRSTWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustRSTWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code Result}. * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRSTWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * <p> * Creates a {@code WSTrustRSTWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRSTWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * Given {@code AssertionType}, convert it into a String * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Given {@code AssertionType}, convert it into a String * @param assertion * @return * @throws ProcessingException */ public static String asString(AssertionType assertion) throws ProcessingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLAssertionWriter writer = new SAMLAssertionWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(assertion); return new String(baos.toByteArray()); }
/** * Marshall the response type to the output stream * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Marshall the response type to the output stream * * @param responseType * @param os * @throws ProcessingException */ public void marshall(ResponseType responseType, OutputStream os) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(os)); samlWriter.write(responseType); }
/** * Convert a SAML2 Response into a Document * * @param responseType * @return * @throws ParserConfigurationException */ public Document convert(ResponseType responseType) throws ProcessingException, ParsingException, ConfigurationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); SAMLResponseWriter writer = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(baos)); writer.write(responseType); ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray()); return DocumentUtil.getDocument(bis); }
/** * Marshall the ResponseType into a writer * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }
/** * Marshall the ResponseType into a writer * * @param responseType * @param writer * @throws ProcessingException */ public void marshall(ResponseType responseType, Writer writer) throws ProcessingException { SAMLResponseWriter samlWriter = new SAMLResponseWriter(StaxUtil.getXMLStreamWriter(writer)); samlWriter.write(responseType); } }