Java Code Examples for org.apache.xml.security.signature.XMLSignatureInput#setOutputStream()

The following examples show how to use org.apache.xml.security.signature.XMLSignatureInput#setOutputStream() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NippinOptionalDeflateTransformer.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
private XMLSignatureInput processElement(XMLSignatureInput input, OutputStream os) throws TechnicalConnectorException, IOException {
   Node el = input.getSubNode();
   if (input.getSubNode().getNodeType() == 3) {
      el = el.getParentNode();
   }

   StringBuilder sb = new StringBuilder();
   this.traverseElement((Element)el, sb);
   if (os == null) {
      byte[] decodedBytes = ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8));
      return new XMLSignatureInput(decodedBytes);
   } else {
      os.write(ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8)));
      XMLSignatureInput output = new XMLSignatureInput((byte[])null);
      output.setOutputStream(os);
      return output;
   }
}
 
Example 2
Source File: NippinOptionalDeflateTransformer.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
private XMLSignatureInput processElement(XMLSignatureInput input, OutputStream os) throws TechnicalConnectorException, IOException {
   Node el = input.getSubNode();
   if (input.getSubNode().getNodeType() == 3) {
      el = el.getParentNode();
   }

   StringBuilder sb = new StringBuilder();
   this.traverseElement((Element)el, sb);
   if (os == null) {
      byte[] decodedBytes = ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8));
      return new XMLSignatureInput(decodedBytes);
   } else {
      os.write(ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8)));
      XMLSignatureInput output = new XMLSignatureInput((byte[])null);
      output.setOutputStream(os);
      return output;
   }
}
 
Example 3
Source File: NippinOptionalDeflateTransformer.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
private XMLSignatureInput processElement(XMLSignatureInput input, OutputStream os) throws TechnicalConnectorException, IOException {
   Node el = input.getSubNode();
   if (input.getSubNode().getNodeType() == 3) {
      el = el.getParentNode();
   }

   StringBuilder sb = new StringBuilder();
   this.traverseElement((Element)el, sb);
   if (os == null) {
      byte[] decodedBytes = ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8));
      return new XMLSignatureInput(decodedBytes);
   } else {
      os.write(ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8)));
      XMLSignatureInput output = new XMLSignatureInput((byte[])null);
      output.setOutputStream(os);
      return output;
   }
}
 
Example 4
Source File: NippinOptionalDeflateTransformer.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
private XMLSignatureInput processElement(XMLSignatureInput input, OutputStream os) throws TechnicalConnectorException, IOException {
   Node el = input.getSubNode();
   if (input.getSubNode().getNodeType() == 3) {
      el = el.getParentNode();
   }

   StringBuilder sb = new StringBuilder();
   this.traverseElement((Element)el, sb);
   if (os == null) {
      byte[] decodedBytes = ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8));
      return new XMLSignatureInput(decodedBytes);
   } else {
      os.write(ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8)));
      XMLSignatureInput output = new XMLSignatureInput((byte[])null);
      output.setOutputStream(os);
      return output;
   }
}
 
Example 5
Source File: NippinOptionalDeflateTransformer.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
private XMLSignatureInput processElement(XMLSignatureInput input, OutputStream os) throws TechnicalConnectorException, IOException {
   Node el = input.getSubNode();
   if (input.getSubNode().getNodeType() == 3) {
      el = el.getParentNode();
   }

   StringBuilder sb = new StringBuilder();
   this.traverseElement((Element)el, sb);
   if (os == null) {
      byte[] decodedBytes = ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8));
      return new XMLSignatureInput(decodedBytes);
   } else {
      os.write(ConnectorIOUtils.decompress(ConnectorIOUtils.toBytes(sb.toString(), Charset.UTF_8)));
      XMLSignatureInput output = new XMLSignatureInput((byte[])null);
      output.setOutputStream(os);
      return output;
   }
}