iaik.smime
Class BinaryCanonicalizer

java.lang.Object
  extended by iaik.smime.BinaryCanonicalizer
All Implemented Interfaces:
Canonicalizer

public class BinaryCanonicalizer
extends java.lang.Object
implements Canonicalizer

A canonicalizer that turns off canonicalization at all. It may be useful in environments where no canonicalization is needed, for instance when transfering multipart/signed S/MIME messages over HTTP (as, e.g., done by AS2).

To enable this Canonicalizer set it as default canonicalizer to be used:

 SMimeParameters.setCanonicalizer(new BinaryCanonicalizer());
 
or (if you do not want to use it by default) set it for your SignedContent object only.

See Also:
SignedContent

Constructor Summary
BinaryCanonicalizer()
          Empty default constructor.
 
Method Summary
 java.io.InputStream canonicalizeInputStream(LineInputStream is, java.lang.String boundary)
          Wraps an canonicalizing input stream around the given input stream
 java.io.OutputStream canonicalizeOutputStream(java.io.OutputStream os, java.lang.String contentType, java.lang.String contentTransferEncoding)
          Wraps an canonicalizing output stream around the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryCanonicalizer

public BinaryCanonicalizer()
Empty default constructor.

Method Detail

canonicalizeOutputStream

public java.io.OutputStream canonicalizeOutputStream(java.io.OutputStream os,
                                                     java.lang.String contentType,
                                                     java.lang.String contentTransferEncoding)
Wraps an canonicalizing output stream around the given output stream.

Specified by:
canonicalizeOutputStream in interface Canonicalizer
Parameters:
os - the output stream where the MIME body part shall be written.
contentType - the MIME content type of the body part to be written
contentTransferEncoding - the content transfer encoding of the body part to be written.
Returns:
the CanonicalizeOutputStream
Throws:
java.io.IOException - if an error has to be thrown when setting the canonicalizing wrapping stream

canonicalizeInputStream

public java.io.InputStream canonicalizeInputStream(LineInputStream is,
                                                   java.lang.String boundary)
Wraps an canonicalizing input stream around the given input stream

Specified by:
canonicalizeInputStream in interface Canonicalizer
Parameters:
is - the input stream representing the MIME entity to be canonicalized
boundary - the boundary line indicating the end of the MIME entity
Returns:
the CanonicalizeInputStream
Throws:
java.io.IOException - if an error has to be thrown when setting the canonicalizing wrapping stream

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC