Win32::SPGP::API - Provides a raw interface to the SPGP library.
Win32::API PGP 5.5.x to 6.x for Windows. (Available at http://www.pgp.com)
use Win32::SPGP::API;
my $spgp = new Win32::SPGP::API;
# Encryption methods $spgp->spgpEncode($BuffIn, \$BuffOut, $BuffOutLen, $Encrypt, $Sign, $SignAlg, $Conv, $ConvAlg, $Armour, $TextMode, $Clear, $Compress, $EyesOnly, $MIME, $CryptKeyID, $SignKeyID, $SignKeyPass, $ConvPass, $Comment, \$MIMEseparator); $spgp->spgpUIEncode($BuffIn, \$BuffOut, $BuffOutLen, $KeyEncrypt, $Sign, $SignAlg, $Conv, $ConvAlg, $Clear, $Compress, $EyesOnly, $MIME, $Comment, \$MIMEseparator, $HWND); $spgp->spgpEncodeFile($FileIn, $FileOut, $Encrypt, $Sign, $SignAlg, $Conv, $ConvAlg, $Armour, $TextMode, $Clear, $Compress, $EyesOnly, $MIME, $CryptKeyID, $SignKeyID, $SignKeyPass, $ConvPass, $Comment, \$MIMEseparator); $spgp->spgpUIEncodeFile($FileIn, $FileOut, $KeyEncrypt, $Sign, $SignAlg, $Conv, $ConvAlg, $Clear, $Compress, $EyesOnly, $MIME, $Comment, \$MIMEseparator, $HWND);
# Decryption methods $spgp->spgpDecode($BuffIn, \$BuffOut, $BuffOutLen, $Pass, \%SigProps); $spgp->spgpDecodeFile($FileIn, $FileOut, $Pass, \%SigProps);
# Key Import/Export methods $spgp->spgpKeyExport($KeyID, \$BuffOut, $BuffOutLen, $ExpPrivate, $ExpComp); $spgp->spgpKeyExportFile($KeyID, $FileOut, $ExpPrivate, $ExpComp); $spgp->spgpKeyImport(\$BuffIn, \$KeyProps, $KeyPropsLen, $Import, $AllProps); $spgp->spgpKeyImportFile($FileIn, \$KeyProps, $KeyPropsLen, $Import, $AllProps);
# Key Manipulation methods $spgp->spgpKeyDisable($KeyID); $spgp->spgpKeyEnable($KeyID); $spgp->spgpKeyGenerate($UserID, $Pass, \$HexID, $Alg, $Cipher, $Size, $Expires, $Fast, $Fail, $HWND); $spgp->spgpKeyPassChange($KeyID, $OldPass, $NewPass); $spgp->spgpKeyRemove($KeyID); $spgp->spgpKeySign($HexID, $UserID, $SignID, $SignPass, $Expires, $Export, $Trust, $Validity); $spgp->spgpKeySigRemove($HexID, $UserID, $SignID); $spgp->spgpSubKeyGenerate($MasterHex, $MasterPass, \$HexID, $Alg, $Size, $Expires, $Fast, $Fail, $HWND);
# Key Properties methods $spgp->spgpKeyProps($KeyID, \$KeyProps, $KeyPropsLen); $spgp->spgpKeyRingID(\$BuffOut, $BuffOutLen); $spgp->spgpKeyRingToFile($FileOut); $spgp->spgpKeyRingCount(); $spgp->spgpKeyIsOnRing($KeyID); $spgp->spgpKeyPropUserID($KeyID, \$BuffOut, $BuffOutLen); $spgp->spgpKeyPropSig($UserID, \$BuffOut, $BuffOutLen); $spgp->spgpKeyPropADK($HexID, \$ADKProps, $ADKPropsLen, \$ADKCount, $Flags); $spgp->spgpKeyRevocationKey($HexID, \$KeyProps, $KeyPropsLen, \$KeyCount, $Flags);
# Data Analysis methods $spgp->spgpAnalyze($BuffIn); $spgp->spgpAnalyzeFile($FileIn); $spgp->spgpAnalyzeEx($BuffIn, \$BuffOut, $BuffOutLen); $spgp->spgpAnalyzeFileEx($FileIn, \$BuffOut, $BuffOutLen);
# Signature methods $spgp->spgpDetachedSigCreate($FileIn, $SigFile, $SignKey, $SignPass, $Comment, $SignAlg, $Armor); $spgp->spgpDetachedSigVerify($SigFile, $SignedFile, \$KeyProps);
# User Interface methods $spgp->spgpUIConfirmationPassphraseDialog(\$Pass, $ShowQuality, $MinQuality, $MinLength, $HWND); $spgp->spgpUIKeyPassphraseDialog($KeyID, \$Pass, $HWND); $spgp->spgpUIRecipientsDialog(\$Recipients, $RecipientsLen, $Caption, $Reserved, $DisplayMarginal, $Reserved, $Reserved, $Reserved, $Reserved, $HWND); $spgp->spgpUISelectKeysDialog($KeyID, \$KeyProps, $Prompt, $KeyPropsLen, $ShowRing, $Flags, $HWND); $spgp->spgpUISigningPassphraseDialog(\$HexID, \$Pass, $Default, $FindKey, $HWND);
# Features methods $spgp->spgpSDKAPIVersion();
# Misc methods $spgp->spgpEstimatePassphraseQuality($Pass); $spgp->spgpGetLastError($Error, \$BuffOut); $spgp->spgpVersion();
Win32::SPGP:API provides a raw interface to the SPGP library (SPGP.DLL). It allows the user to perform the following basic functions with PGP for Windows:
Encrypting & decrypting strings and files Creating & verifying digital signatures Examining the properties of keys and signatures Importing and exporting keys
All strings passed to methods are automatically terminated with nulls. All strings returned from methods will already have their nulls and trailing whitespace stripped.
A full descriptive reference for all the functions may be found at http://www.oz.net/~srheller/spgp/funcref/
spgpEncode Encrypt and/or sign text using conventional or public-key encryption. spgpUIEncode An alternative version of spgpEncode which uses PGP's user-interface dialogs to gather information about keys and passphrases. PGP 6.x only. spgpEncodeFile Encrypt and/or sign a file using conventional or public-key encryption. spgpUIEncodeFile An alternative version of spgpEncodeFile which uses PGP's user-interface dialogs to gather information about keys and passphrases. PGP 6.x only
spgpDecode Decrypt and/or verify text which has been public-key or conventionally (passphrase) encrypted. spgpDecodeFile Decrypt and/or verify a file which has been public-key or conventionally (passphrase) encrypted.
spgpKeyExport Exports a key or keys to an ASCII-armored key block. spgpKeyExportFile Exports a key or keys to a text file. spgpKeyImport Import a key or keys from a text buffer. spgpKeyImportFile Imports a key or keys from a file.
spgpKeyDisable Disable a public key. spgpKeyEnable Enable a public key. spgpKeyGenerate Generate a public-private key-pair. (Experimental, subject to change) spgpKeyPassChange Change the passphrase of a private key. spgpKeyRemove Delete a key from the local key-ring. spgpKeySign Sign a specific user ID on a given key. spgpKeySigRemove Remove a signature from a key's user ID. spgpSubKeyGenerate Generate an encryption sub-key and attach it to an existing key-pair. (Experimental, subject to change)
spgpKeyProps Extract the properties of a key or keys. spgpKeyRingID Extract the ID strings of all the keys on the default key-ring. spgpKeyRingToFile Extract the properties of all the keys on the default key-ring and save them to a text file. spgpKeyRingCount Returns the number of keys on the default key-ring. spgpKeyIsOnRing Verifies the presence of a key on the default key-rings. spgpKeyPropUserID Extracts all the user IDs from a key. spgpKeyPropSig Extracts the key ID from the signature(s) on a key's user ID. spgpKeyPropADK Extracts the properties of a key's Additional Decryption Key(s), if any. spgpKeyPropRevocationKey Extracts the properties of a key's designated revocation key(s), if any.
spgpAnalyze Analyzes data and reports as to whether the data is encrypted, signed, etc. spgpAnalyzeFile Analyzes a file and reports as to whether the data is encrypted, signed, etc. spgpAnalyzeEx Analyzes data and reports as to whether the data is encrypted, signed, etc., and returns extended information. spgpAnalyzeFileEx Analyzes a file and reports as to whether the data is encrypted, signed, etc., and returns extended information.
spgpDetachedSigCreate Create a detached signature for a file. spgpDetachedSigVerify Verify the detached signature for a file.
(Not yet implemented.)
spgpUIConfirmationPassphraseDialog spgpUIKeyPassphraseDialog (PGP 6.x only) spgpUIRecipientsDialog (PGP 6.x only) spgpUISelectKeysDialog (PGP 6.x only) spgpUISigningPassphraseDialog
spgpSdkApiVersion
spgpEstimatePassphraseQuality spgpGetErrorString spgpVersion
Win32::SPGP::API Version 2.00 January 17, 2001. SPGP.dll Version 2.5.6.0 October 21, 2000.
Module Author: Grant Hopwood mailto:hopwoodg@valero.com Library Author: S.R.Heller mailto:srheller@oz.net
You can do whatever you like with the Win32::SPGP::API.pm module.
SPGP.DLL copyright 2000 S.R.Heller. http://www.oz.net/~srheller/spgp/