IPWorks Encrypt 2020 Python Edition

Questions / Feedback?

OpenPGP Class

Properties   Methods   Events   Configuration Settings   Errors  

The OpenPGP class is used to encrypt/decrypt and sign/verify PGP messages.


class ipworksencrypt.OpenPGP


The OpenPGP class supports encrypting/decrypting and signing/verifying OpenPGP messages in the format specified by RFC 4880.

The encrypt, sign, and sign_and_encrypt 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, verify_signature, and decrypt_and_verify_signature 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:

Property List

The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

ascii_armorSpecifies whether to use ASCII armor to encode the output message.
auto_select_algorithmsWhether to automatically select algorithms when encrypting or signing.
clear_signatureSpecifies whether or not to create a cleartext signature.
compression_methodThe compression algorithm used.
detached_signatureSpecifies whether or not to generate a detached signature when signing a message.
encrypting_algorithmThe encryption algorithm used when encrypting.
input_fileThe file to process.
input_messageThe message to process.
key_countThe number of records in the Key arrays.
key_encodedThe key.
key_keyringThe location of the keyring.
key_passphraseThe passphrase for the key's secret key (if any).
key_user_idThe user Id of the key.
message_header_countThe number of records in the MessageHeader arrays.
message_header_fieldThis property contains the name of the HTTP header (same case as it is delivered).
message_header_valueThis property contains the header contents.
output_fileThe output file.
output_messageThe output message after processing.
overwriteIndicates whether or not the class should overwrite files.
recipient_key_countThe number of records in the RecipientKey arrays.
recipient_key_encodedThe key.
recipient_key_keyringThe location of the keyring.
recipient_key_user_idThe user Id of the key.
signer_key_countThe number of records in the SignerKey arrays.
signer_key_encodedThe key.
signer_key_keyringThe location of the keyring.
signer_key_user_idThe user Id of the key.
signing_algorithmThe 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.

configSets or retrieves a configuration setting.
decryptDecrypts the message.
decrypt_and_verify_signatureDecrypts and verifies the signature of the message.
encryptEncrypts the message.
get_recipient_infoGets recipient information for an encrypted message.
resetResets the class properties.
signSigns the message.
sign_and_encryptSigns and encrypts the current message.
verify_signatureVerifies 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.

on_errorInformation about errors during data delivery.
on_key_passphraseFired if the passphrase of current key is incorrect or empty.
on_progressFired as progress is made.
on_recipient_infoFired for each recipient key of the encrypted message.
on_signature_infoFired during verification of the signed message.
on_statusShows the progress of the operation.
on_verification_statusFired 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.

AllowEmptyInputWhether to allow empty files for input.
AllowOldPacketTypeWhether to allow the older encrypted packet type.
CompressionLevelThe level of compression used.
DeleteOutputFileOnErrorWhether to delete the output file on an error.
DetachedSignatureDataThe detached signature.
EnsureValidDSASignatureHashAlgorithmWhether or not to select a suitable signature hash algorithm automatically.
FileNameThe original name of the encrypted file.
KeyIdLengthThe length of the KeyId available.
KeySelectionMethodThe method used to select a key for encryption or signing.
LogLevelSpecifies the level of detail that is logged.
PGPZipDirThe directory used when creating or extracting a PGP zip file.
ProgressEventThresholdThe amount of data in bytes to process before firing the progress event.
PublicKeyringFileThe file name of the public keyring file.
ReadFromProgressEventWhether to read input data from inside the progress event.
RecursiveDecryptModeWhether the encrypted data should be decrypted recursively.
RequireEncryptionWhether to throw an error when decrypting and encryption is not detected.
RequireIntegrityProtectedPacketWhether an MDC packet is required for decryption.
RequireSignatureWhether to throw an error when verifying a signature and no signature is found.
RequireValidSignatureSpecifies if an invalid signature is considered an error condition.
SecretKeyringFileThe file name of the secret keyring file.
SplitHeadersControls whether ASCII Armor headers are split or not.
SymmetricPassphraseThe password used for symmetric encryption or decryption.
UseFipsCompliantAlgorithmsRestricts the usage to FIPS compliant algorithms only.
UsePlatformAESWhether to use the platform AES implementation.
VersionHeaderThe Version header value in the ASCII armored OpenPGP message.
WriteToProgressEventWhether to write output data so it is accessible from inside the progress event.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Python Edition - Version 20.0 [Build 8161]