Scriptability

Scriptability is the feature of any software to interact with other tools in the standard UNIX way. Some of the features which make a software scriptable are:

  1. Output error messages to standard error.
  2. When operation is successful, do not output any message.
  3. Read input from standard input, and write to standard output [This is one feature WizCrypt does not support. The support for this is also not planned, as it is not considered as a critical feature required by WizCrypt.]
  4. Defined program exit status [explained in the next section].

Exit Status Of WizCrypt

The following are the exit status supported by WizCrypt:

1Error in IOOccurs when the file is not
readable/writable, or the file does not exist.
2Invalid passwordPassword supplied is either too short or too
long.
3Password mismatchWrong password is supplied.
4Multiple exceptionsWhen more than one exception has happened.
5Security ExceptionWhen you try to run the application with
J2RE1.4, or when you have supplied a small
password.
6Parse ExceptionWhen the command line arguments are not
as expected.
7Console not availableThe application expects password from console,
but it is running in headless state (eg.
when the application is started using cron).
8Destination file existsWhen the destination file (FILE.ext.wiz during
encryption, FILE.ext during decryption) exists
. When -f option is given, this exit status
will not be generated.
0Clean ExitWhen the program exits without any problem
after finishing its operation in the expected
way.
Exit Status

Note: When WizCrypt is doing an operation on a batch of files, and when it gives any one of the statuses from 1-8, it means any one or more of the files in the batch has experienced that specific problem(s).

Example

Consider you are decrypting three files: x.wiz, y.wiz and z.wiz:

$ java -jar wizcrypt-XX-jar-with-dependencies.jar -e -p passwd x.wiz y.wiz z.wiz

If x.wiz's password is not "passwd", and y.wiz does not exist in the directory, and z.wiz gets decrypted, the program exits with code 4.