Duane Hinkley > Crypt-Simple-SMIME > Crypt::Simple::SMIME

Download:
Crypt-Simple-SMIME-0.9.tar.gz

Dependencies

Annotate this POD (1)

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.9   Source  

NAME ^

Crypt::Simple::SMIME - Simple SMIME Email Encryptor

SYNOPSIS ^

use Crypt::Simple::SMIME;

my $c = new Crypt::Simple::SMIME( { 'openssl' => '/opt/openssl/bin/openssl', 'sendmail' => '/usr/sbin/sendmail' 'certificate' => '/home/bob/certificate.pem' } );

or:

my $c = new Crypt::Simple::SMIME();

$c->OpenSSLPath('/opt/openssl/bin/openssl');

$c->SendmailPath('/usr/sbin/sendmail');

$c->CertificatePath('/home/bob/certificate.pem')

$c->SendMail($from,$to,$subject,$message);

$c->Close();

or:

my $c = new Crypt::Simple::SMIME();

$c->SignedEmailCertificate($signed_email_text)

$c->SendMail($to,$from,$subject,$message);

$c->Close();

or:

my $c = new Crypt::Simple::SMIME();

$c->SignedEmailCertificate($signed_email_file)

$c->SendMail($to,$from,$subject,$message);

$c->Close();

or:

my $c = new Crypt::Simple::SMIME();

$c->Certificate($certificate_text)

$c->SendMail($to,$from,$subject,$message);

$c->Close();

DESCRIPTION ^

After looking around for a simple way to send encrypted email to Outlook, Mozilla and Netscape email clients, the modules had requirements that required installing and/or compiling other software. This module is a simple and secure method of sending encrypted email.

No encrypted files are written to the hard drive. So there's no chance of others accessing the information. The only files stored on the hard drive is public keys/certificates

REQUIREMENTS ^

The only two requirements are the openssl binary be installed on the system and the system has Sendmail or a binary that emulates Sendmail. For example Qmail provides a binary to emulate Sendmail.

METHODS ^

The methods described in this section are available for all Crypt::Simple::SMIME objects.

new(%hash)

The new method is the constructor. The input hash can inlude the following:

openssl / Path to the openssl binary on your system (optional) sendmail / Path to the sendmail binary on your system (optional)

my $2 = new Crypt::Simple::SMIME( { 'openssl' => '/opt/openssl/bin/openssl', 'sendmail' => '/usr/sbin/sendmail' 'certificate' => '/home/bob/certificate.pem' } );

or:

my $c = new Crypt::Simple::SMIME();

$c->SendMail($from,$to,$subject,$message)

Given the from address, to address, subject and the message, encrypts and sends the message to the given address.

$c->Close()

Cleans up after the module by deleting temporary files.

DATA ACCESSORS ^

The methods described in this section allow setting and reading data.

$c->OpenSSLPath($openssl_path)

If a the open sll binary path is passed, this accessor will set the value. It will always return the value stored.

$c->SendmailPath($sendmail_path)

If a the sendmail binary path is passed, this accessor will set the value. It will always return the value stored.

$c->CertificatePath($certificate_path)

If a the sendmail binary path is passed, this accessor will set the value. It will always return the value stored.

$c->SignedEmailCertificate($certificate)

Accepts the text of a signed email or the path to a file that contains the email. It returns the text of a signed email.

To get a certificate from asigned email, save the message to a file and and pass the contents this routine.

$c->Certificate($certificate)

Accepts the certificate contents from a variable to use to encrypt the message.

$c->Error()

Returns true if the module encountered an error.

$c->ErrorMessage()

Returns the error message module encountered an error.

$c->EncryptCommand()

Returns the command used to encrypt the email.

ERRORS/BUGS ^

Any erros

This will occur if your LWP does not support SSL (i.e. https). I suggest installing the Crypt::SSLeay module.

IDEAS/TODO ^

Build methods for each type of transaction so you don't need to know UTIs and other FedEx codes. FedEx Express Ship-A-Package UTI 2016 would be called via $object->FDXE_ship();

AUTHOR ^

Duane Hinkley, <duane@dhwd.com>

http://www.dhwd.com

If you have any questions, comments or suggestions please feel free to contact me.

COPYRIGHT ^

Copyright 1995-2004, Down Home Web Design, Inc. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AVAILABILITY ^

The latest version of this module is likely to be available from CPAN as well as:

http://www.dhwd.com/

SEE ALSO ^

Crypt::SSLeay, LWP::UserAgent, Business::FedEx::Constants

1;

syntax highlighting: