Class EnvelopeSerializer

java.lang.Object
com.aquima.interactions.foundation.security.r4.EnvelopeSerializer

public final class EnvelopeSerializer extends Object
Envelope serializer.
Since:
5.1
Author:
m.hesselink
  • Method Details

    • serialize

      public static void serialize(IEnvelope envelope, OutputStream stream, boolean useIndentation)
      Serialize an envelope. The serializer flushes the ouput stream, but does not close the stream after the envelope has been serialized to the output stream
      Parameters:
      envelope - envelope containing a message and a signature
      stream - stream to write the envelope to
      useIndentation - if set to true, the serialize uses indentation for nested xml tags
      Throws:
      CryptoGraphicException - when one or more arguments are not provided
      CryptoGraphicException - when the envelope is not a valid R4 envelope
    • deserialize

      public static void deserialize(IEnvelope envelope, InputStream stream)
      Deserialize an envelope. The deserializer does not close the input stream
      Parameters:
      envelope - A empty release 4 version of the envelope
      stream - stream th read the envelope from
      Throws:
      CryptoGraphicException - when one or more arguments are not provided
      CryptoGraphicException - when the envelope could not be created
    • deserializeR6

      public static IEnvelope deserializeR6(InputStream stream) throws IOException
      Deserialize an envelope. The deserializer does not close the input stream
      Parameters:
      stream - stream th read the envelope from
      Returns:
      Envelope containing the parsed result from the input stream.
      Throws:
      IOException - when the resource could not be read
      CryptoGraphicException - when the envelope could not be created
    • deserializeR12

      public static IEnvelope deserializeR12(byte[] bytes) throws IOException
      Throws:
      IOException