NAME

GnuPG::Crypticle - Encryption/decryption module

VERSION

Version 0.022

SYNOPSIS

use GnuPG::Crypticle;

my $crypticle = GnuPG::Crypticle->new(gpg_home => /home/me/.gnupg);
$crypticle->encrypt(src => '/tmp/sourcefile.txt', dst => '/tmp/destfile.gpg', rcpt => 'ABCD0123');
...

gpg_bin

full path to gpg binary

gpg_home

location of the .gnupg directory gpg should use

gpg_pass_file

plaintext file containing the passphrase used with any secret keys

gpg_temp_home

path to use as temporary home

SUBROUTINES/METHODS

Parameters are passed to all subroutines as a key/value list (hash) e.g.,

subroutine(key1 => val1, key2 => val2);

BUILD

During object initialization, copies of master gpg keyrings are made in a temporary directory to prevent locking and corruption issues. A restart of the application is necessary if there are key ring changes. Dies on failure.

decrypt

Encrypts from a source to destination file. Croaks on decryption failure, including signature failure.

parameters:

src

file name or handle to be decrypted

dst

file name or handle to which decrypted output is sent

returns:

    valid signature if present, or true

encrypt

Dies on failure

parameters:

src

file name or handle to be encrypted

dst

file name or handle to which encrypted output is sent

gpg_args

arguments passed directly to gpg execution

returns:

    valid signature if present, or true

detect_encryption

Dies on failure. Detects pgp or gpg decryption the same as mime magic does.

This is nowhere near complete or reliable. For best results, just try to decrypt.

parameters:

file

file name or handle from which to detect encryption

call_gpg

(private) calls gpg command with necessary options

_open_passphrase_file

(private) Opens the passphrase file.

_open_dev_null

(private) returns a filehandle to /dev/null

AUTHOR

Brad Barden, <iamb at mifflinet.net>

BUGS

Please report any bugs or feature requests to Brad Barden.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc GnuPG::Crypticle

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2012 Brad Barden.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.