org.wiztools.wizcrypt
Class WizCrypt

java.lang.Object
  extended by org.wiztools.wizcrypt.WizCrypt

public final class WizCrypt
extends java.lang.Object

This class has the public APIs of WizCrypt application to do encryption and decryption.

Author:
subhash
See Also:
CipherKeyGen, CipherKey

Method Summary
static void decrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck)
           
static void decrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck, Callback cb)
           
static void decrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck, Callback cb, long size)
          This is the public API exposed to decrypt.
static void encrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck)
           
static void encrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck, Callback cb)
           
static void encrypt(java.io.InputStream is, java.io.OutputStream os, CipherKey ck, Callback cb, long size)
          This is the public API exposed to encrypt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encrypt

public static void encrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck,
                           Callback cb,
                           long size)
                    throws java.io.IOException
This is the public API exposed to encrypt.

Parameters:
is - The input stream that needs to be encrypted.
os - The output stream where the encrypted content of is need to be written.
ck - The CipherKey object. This has to be created by passing the password to CipherKeyGen.getCipherKeyForEncrypt(String keyStr).
cb - Callback object for monitoring the progress.
size - The size of the is stream. When this is passed, the Callback.notifyProgress(long value) will receive the percentage completed. If this is not passed, it will get the number of bytes read and processed.
Throws:
java.io.IOException - IOException is thrown when faced with IO issues during read/write.
See Also:
CipherKeyGen.getCipherKeyForEncrypt(String keyStr), CipherKey, Callback

encrypt

public static void encrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck)
                    throws java.io.IOException
Throws:
java.io.IOException
See Also:
encrypt(InputStream is, OutputStream os, CipherKey ck, Callback cb, long size)

encrypt

public static void encrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck,
                           Callback cb)
                    throws java.io.IOException
Throws:
java.io.IOException
See Also:
encrypt(InputStream is, OutputStream os, CipherKey ck, Callback cb, long size)

decrypt

public static void decrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck,
                           Callback cb,
                           long size)
                    throws java.io.IOException,
                           PasswordMismatchException
This is the public API exposed to decrypt.

Parameters:
is - The input stream that needs to be decrypted.
os - The output stream where the decrypted content of is need to be written.
ck - The CipherKey object. This has to be created by passing the password to CipherKeyGen.getCipherKeyForDecrypt(String keyStr).
cb - Callback object for monitoring the progress.
size - The size of the is stream. When this is passed, the Callback.notifyProgress(long value) will receive the percentage completed. If this is not passed, it will get the number of bytes read and processed.
Throws:
PasswordMismatchException - PasswordMismatchException is thrown when the supplied password is wrong.
java.io.IOException - IOException is thrown when faced with IO issues during read/write.
See Also:
CipherKeyGen.getCipherKeyForDecrypt(String keyStr), CipherKey, Callback

decrypt

public static void decrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck)
                    throws java.io.IOException,
                           PasswordMismatchException
Throws:
java.io.IOException
PasswordMismatchException
See Also:
decrypt(InputStream is, OutputStream os, CipherKey ck, Callback cb, long size)

decrypt

public static void decrypt(java.io.InputStream is,
                           java.io.OutputStream os,
                           CipherKey ck,
                           Callback cb)
                    throws java.io.IOException,
                           PasswordMismatchException
Throws:
java.io.IOException
PasswordMismatchException
See Also:
decrypt(InputStream is, OutputStream os, CipherKey ck, Callback cb, long size)


Copyright © 2007. All Rights Reserved.