SafeAPI v1.20

com.safeapi
Class CryptoDir

java.lang.Object
  extended bycom.safeapi.CryptoCommon
      extended bycom.safeapi.CryptoDir

public final class CryptoDir
extends CryptoCommon

Direction encryption/decryption APIs Module


Constructor Summary
CryptoDir()
          Loads an instance of CryptoDir
 
Method Summary
 boolean addRecipient(String sListName, String sKeyID)
          Adds a new recipient to the list.
 void asymDecryptDir(String sKeyID, char[] caPassphrase, String sInputDir, String sOutputDir)
          Decrypt a direcotry with an asymmetric cipher for the specified private key
 void asymEncryptDir(String sInputDir, String sOutputDir, String sListName)
          Encrypt a directory with an asymmetric cipher to recipients in the specified list NOTE : sListName is for further release.
 void createRecipients(String sListName)
          Creates a new recipient list for RSA file encryption.
 void createRecipientsTune(String sListName, int nInitialCapacity, int nCapacityIncrement)
          Create a new recipient list for RSA file encryption.
 void decryptDir(String sKeyID, char[] caPassphrase, String sInputDir, String sOutputDir)
          Decrypts the specified directory with the key ID
 void decryptDirWithPassphrase(String sAlgorithm, char[] caPassphrase, String sInputDir, String sOutputDir)
          Decrypt the specified directory with the key derived from a passphrase.
 void encryptDir(String sKeyID, char[] caPassphrase, String sInputDir, String sOutputDir)
          Encrypts the specified directory with a secret key
 void encryptDirWithPassphrase(String sAlgorithm, char[] caPassphrase, String sInputDir, String sOutputDir)
          Encrypts the specified directory with the key derived from a passphrase.
 String getRecipients(String sListName)
          Gets the recipients list.
 boolean removeRecipient(String sListName, String sKeyID)
          Removes a recipient from the list.
 void removeRecipients(String sListName)
          Deletes the recipients list.
 
Methods inherited from class com.safeapi.CryptoCommon
createSeedFile, getParameter, getRandomBytes, getRawError, getRegisteredError, getVersion, isOperationOK, setParameter, wipe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptoDir

public CryptoDir()
Loads an instance of CryptoDir

Method Detail

addRecipient

public boolean addRecipient(String sListName,
                            String sKeyID)
Adds a new recipient to the list.

NOTE : parameter ListName is for later use.

Parameters:
sListName - The name for this list
sKeyID - The key ID for this recipient
Returns:
True if added successfully, false otherwise

createRecipients

public void createRecipients(String sListName)
Creates a new recipient list for RSA file encryption.

NOTE : parameter ListName is for later use.

Parameters:
sListName - The name for this list

createRecipientsTune

public void createRecipientsTune(String sListName,
                                 int nInitialCapacity,
                                 int nCapacityIncrement)
Create a new recipient list for RSA file encryption.

NOTE : parameter ListName is for later use.

Parameters:
sListName - The name for this list
nInitialCapacity - The initial capacity of the vector
nCapacityIncrement - The amount by which the capacity is increased when the vector overflows

getRecipients

public String getRecipients(String sListName)
Gets the recipients list.

Parameters:
sListName - The name for this list
Returns:
the recipients list

removeRecipient

public boolean removeRecipient(String sListName,
                               String sKeyID)
Removes a recipient from the list.

NOTE : parameter ListName is for later use.

Parameters:
sListName - The name for this list
sKeyID - The key ID or file path for this recipient
Returns:
True if removed successfully, false otherwise

removeRecipients

public void removeRecipients(String sListName)
Deletes the recipients list.

NOTE : parameter ListName is for later use.

Parameters:
sListName - The name for this list
Returns:
True if removed successfully, false otherwise

encryptDirWithPassphrase

public void encryptDirWithPassphrase(String sAlgorithm,
                                     char[] caPassphrase,
                                     String sInputDir,
                                     String sOutputDir)
Encrypts the specified directory with the key derived from a passphrase.

Parameters:
sAlgorithm - The encryption algorithm
caPassphrase - The passphrase for the PBE key to use
sInputDir - The full path of the directory to encrypt
sOutputDir - The full path of the output directory

decryptDirWithPassphrase

public void decryptDirWithPassphrase(String sAlgorithm,
                                     char[] caPassphrase,
                                     String sInputDir,
                                     String sOutputDir)
Decrypt the specified directory with the key derived from a passphrase.

Parameters:
sAlgorithm - The encryption algorithm
caPassphrase - The passphrase for the PBE key to use
sInputDir - The full path of the directory to encrypt
sOutputDir - The full path of the output directory

encryptDir

public void encryptDir(String sKeyID,
                       char[] caPassphrase,
                       String sInputDir,
                       String sOutputDir)
Encrypts the specified directory with a secret key

Parameters:
sKeyID - The Key ID
caPassphrase - The secret key passphrase protection
sInputDir - The full path of the directory to encrypt
sOutputDir - The full path of the output directory

decryptDir

public void decryptDir(String sKeyID,
                       char[] caPassphrase,
                       String sInputDir,
                       String sOutputDir)
Decrypts the specified directory with the key ID

Parameters:
sKeyID - The Key ID
caPassphrase - The secret key passphrase protection
sInputDir - The full path of the directory to encrypt
sOutputDir - The full path of the output directory

asymEncryptDir

public void asymEncryptDir(String sInputDir,
                           String sOutputDir,
                           String sListName)
Encrypt a directory with an asymmetric cipher to recipients in the specified list NOTE : sListName is for further release.

Parameters:
sInputDir - The input directory to encrypt
sOutputDir - The destination directory for the encrypted files
sListName - The recipients list name

asymDecryptDir

public void asymDecryptDir(String sKeyID,
                           char[] caPassphrase,
                           String sInputDir,
                           String sOutputDir)
Decrypt a direcotry with an asymmetric cipher for the specified private key

Parameters:
sKeyID - The Key ID of the private key to use
caPassphrase - The passphrase which protects this private key
sInputDir - The input directory to decrypt
sOutputDir - The destination directory for the decrypted files

SafeAPI v1.20

Copyright © SafeLogic 2005