Skip navigation links

Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10680-05


oracle.security.xmlsec.enc
Class EncryptOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by oracle.security.xmlsec.enc.EncryptOutputStream

All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class EncryptOutputStream
extends java.io.FilterOutputStream

This class is similar to the CipherOutputStream, except that it does two special things to conform to XML encryption, a) it emits the IntializationVector at the beginning of the stream and b) it emits a padding at the end of the stream .
Note: the cipher object must be set up for NoPadding, or for ISO10126Padding
If you are using a nonce, you must write the nonce into the EncryptOutputStream in the beginning, that way it will get encrypted.

Since:
release specific (what release of product did this appear in)
Version:
$Header: ldap/java/src/oracle/security/xmlsec/enc/EncryptOutputStream.java /main/1 2008/12/17 15:42:25 pdatta Exp $

Field Summary

 

Fields inherited from class java.io.FilterOutputStream
out

 

Constructor Summary
EncryptOutputStream(java.io.OutputStream os, javax.crypto.Cipher c)
           

 

Method Summary
 void close()
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           

 

Methods inherited from class java.io.FilterOutputStream
flush, write

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

EncryptOutputStream

public EncryptOutputStream(java.io.OutputStream os,
                           javax.crypto.Cipher c)
                    throws java.io.IOException
Throws:
java.io.IOException

Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

Skip navigation links

Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10680-05


Copyright © 2005, 2013 , Oracle. All rights reserved.