public class EncryptingOutputStream
extends java.io.OutputStream
DecryptingInputStream to transport data securely.| Constructor and Description |
|---|
EncryptingOutputStream(java.io.OutputStream wrapped,
java.security.PublicKey receiverKey,
java.security.SecureRandom rand)
Constructs an EncryptingOutputStream using default symmetric encryption parameters.
|
EncryptingOutputStream(java.io.OutputStream wrapped,
java.security.PublicKey receiverKey,
java.lang.String algorithm,
java.security.SecureRandom rand,
int strength,
java.lang.String mode,
java.lang.String padding)
Constructs an EncryptingOutputStream.
|
public EncryptingOutputStream(java.io.OutputStream wrapped,
java.security.PublicKey receiverKey,
java.security.SecureRandom rand)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
wrapped - outputstream to store the encrypted datareceiverKey - the receiver's public key for encrypting the symmetric keyrand - a secure source of randomnessjava.io.IOException - Signals that an I/O exception has occurred.java.security.NoSuchAlgorithmException - the no such algorithm exceptionjavax.crypto.NoSuchPaddingException - the no such padding exceptionjava.security.InvalidKeyException - the invalid key exceptionjavax.crypto.BadPaddingException - the bad padding exceptionjavax.crypto.IllegalBlockSizeException - the illegal block size exceptionpublic EncryptingOutputStream(java.io.OutputStream wrapped,
java.security.PublicKey receiverKey,
java.lang.String algorithm,
java.security.SecureRandom rand,
int strength,
java.lang.String mode,
java.lang.String padding)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
wrapped - outputstream to store the encrypted datareceiverKey - the receiver's public key for encrypting the symmetric keyalgorithm - symmetric encryption algorithm (e.g. "AES")rand - a secure source of randomnessstrength - the key size in bits (e.g. 128)mode - encryption mode (e.g. "CBC")padding - padding scheme (e.g. "PKCS5PADDING")java.io.IOException - Signals that an I/O exception has occurred.java.security.NoSuchAlgorithmException - the no such algorithm exceptionjavax.crypto.NoSuchPaddingException - the no such padding exceptionjava.security.InvalidKeyException - the invalid key exceptionjavax.crypto.BadPaddingException - the bad padding exceptionjavax.crypto.IllegalBlockSizeException - the illegal block size exceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.