OpenPGP Class
Properties Methods Events Configuration Settings Errors
The OpenPGP component is used to encrypt/decrypt and sign/verify PGP messages.
Class Name
IPWorksEncrypt_OpenPGP
Procedural Interface
ipworksencrypt_openpgp_open(); ipworksencrypt_openpgp_close($res); ipworksencrypt_openpgp_register_callback($res, $id, $function); ipworksencrypt_openpgp_get_last_error($res); ipworksencrypt_openpgp_get_last_error_code($res); ipworksencrypt_openpgp_set($res, $id, $index, $value); ipworksencrypt_openpgp_get($res, $id, $index); ipworksencrypt_openpgp_do_config($res, $configurationstring); ipworksencrypt_openpgp_do_decrypt($res); ipworksencrypt_openpgp_do_decryptandverifysignature($res); ipworksencrypt_openpgp_do_encrypt($res); ipworksencrypt_openpgp_do_getrecipientinfo($res); ipworksencrypt_openpgp_do_reset($res); ipworksencrypt_openpgp_do_sign($res); ipworksencrypt_openpgp_do_signandencrypt($res); ipworksencrypt_openpgp_do_verifysignature($res);
Remarks
The OpenPGP class supports encrypting/decrypting and signing/verifying OpenPGP messages in the format specified by RFC 4880.
The Encrypt, Sign, and SignAndEncrypt methods are used to create a message to be sent to your partner. You can additionally create messages bound for multiple recipients with different keys, simultaneously encrypt and compress with the most popular compression algorithms, and control other aspects such as the encrypting algorithm to use.
When a message is received, the Decrypt, VerifySignature, and DecryptAndVerifySignature methods are used to process the incoming message.
The Key* properties specify the key (with private key) used to sign and decrypt.
The SignerKey* properties specify the key used to verify a signature.
The RecipientKey* properties specify the key used to encrypt.
Input and Output Properties
The class will determine the source and destination of the input and output based on which properties are set.
The order in which the input properties are checked is as follows:
When a valid source is found the search stops. The order in which the output properties are checked is as follows:- OutputFile
- OutputMessage: The output data is written to this property if no other destination is specified.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
ASCIIArmor | Specifies whether to use ASCII armor to encode the output message. |
ClearSignature | Specifies whether or not to create a cleartext signature. |
CompressionMethod | The compression algorithm used. |
DetachedSignature | Specifies whether or not to generate a detached signature when signing a message. |
EncryptingAlgorithm | The encryption algorithm used when encrypting. |
InputFile | The file to process. |
InputMessage | The message to process. |
KeyCount | The number of records in the Key arrays. |
KeyEncoded | The key. |
KeyKeyring | The location of the keyring. |
KeyPassphrase | The passphrase for the key's secret key (if any). |
KeyUserId | The user Id of the key. |
MessageHeaderCount | The number of records in the MessageHeader arrays. |
MessageHeaderField | This property contains the name of the HTTP header (same case as it is delivered). |
MessageHeaderValue | This property contains the header contents. |
OutputFile | The output file. |
OutputMessage | The output message after processing. |
Overwrite | Indicates whether or not the component should overwrite files. |
RecipientKeyCount | The number of records in the RecipientKey arrays. |
RecipientKeyEncoded | The key. |
RecipientKeyKeyring | The location of the keyring. |
RecipientKeyUserId | The user Id of the key. |
SignerKeyCount | The number of records in the SignerKey arrays. |
SignerKeyEncoded | The key. |
SignerKeyKeyring | The location of the keyring. |
SignerKeyUserId | The user Id of the key. |
SigningAlgorithm | The signature hash algorithm used when signing. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
Decrypt | Decrypts the message. |
DecryptAndVerifySignature | Decrypts and verifies the signature of the message. |
Encrypt | Encrypts the message. |
GetRecipientInfo | Gets recipient information for an encrypted message. |
Reset | Resets the component properties. |
Sign | Signs the message. |
SignAndEncrypt | Signs and encrypts the current message. |
VerifySignature | Verifies the signature of the current message. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
KeyPassphrase | Fired if the passphrase of current key is incorrect or empty. |
Progress | Fired as progress is made. |
RecipientInfo | Fired for each recipient key of the encrypted message. |
SignatureInfo | Fired during verification of the signed message. |
Status | Shows the progress of the operation. |
VerificationStatus | Fired after verification of the signed message. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
AllowEmptyInput | Whether to allow empty files for input. |
AllowOldPacketType | Whether to allow the older encrypted packet type. |
AutoSelectAlgorithms | Whether to automatically select algorithms when encrypting or signing. |
AutoSelectCipherAlgorithm | Whether to automatically select the cipher algorithm when encrypting. |
AutoSelectMACAlgorithm | Whether to automatically select the MAC algorithm when signing. |
AutoSelectCompressionAlgorithm | Whether to automatically select the compression algorithm. |
CompressionLevel | The Zip or Zlib compression level. |
DetachedSignatureData | The detached signature. |
FileName | The original name of the encrypted file. |
PGPZipDir | The directory used when creating or extracting a PGP zip file. |
RequireValidSignature | Specifies if an invalid signature is considered an error condition. |
SplitHeaders | Controls whether ASCII Armor headers are split or not. |
SymmetricPassphrase | The password used for symmetric encryption or decryption. |
PublicKeyringFile | The file name of the public keyring file. |
SecretKeyringFile | The file name of the secret keyring file. |
AutoSelectDSASignatureHashAlgorithm | Whether or not to select a suitable signature hash algorithm automatically. |
VersionHeader | The Version header value in the ASCII armored OpenPGP message. |
LogLevel | Specifies the level of detail that is logged. |
ProgressEventThreshold | The amount of data in bytes to process before firing the progress event. |
ReadFromProgressEvent | Whether to read input data from inside the progress event. |
WriteToProgressEvent | Whether to write output data so it is accessible from inside the progress event. |
UseFipsCompliantAlgorithms | Restricts the usage to FIPS compliant algorithms only. |
RecursiveDecryptMode | Whether the encrypted data should be decrypted recursively. |
CodePage | The system code page used for Unicode to Multibyte translations. |