IPWorks OpenPGP 2020 Node.js Edition

Questions / Feedback?

OpenPGP Class

Properties   Methods   Events   Configuration Settings   Errors  

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

Syntax

ipworksopenpgp.openpgp()

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:

Property List


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

ASCIIArmorSpecifies whether to use ASCII armor to encode the output message.
AutoSelectAlgorithmsWhether to automatically select algorithms when encrypting or signing.
ClearSignatureSpecifies whether or not to create a cleartext signature.
CompressionMethodThe compression algorithm used.
DetachedSignatureSpecifies whether or not to generate a detached signature when signing a message.
EncryptingAlgorithmThe encryption algorithm used when encrypting.
InputFileThe file to process.
InputMessageThe message to process.
KeyCountThe number of records in the Key arrays.
KeyEncodedThe key.
KeyKeyringThe location of the keyring.
KeyPassphraseThe passphrase for the key's secret key (if any).
KeyUserIdThe user Id of the key.
MessageHeaderCountThe number of records in the MessageHeader arrays.
MessageHeaderFieldThis property contains the name of the HTTP header (same case as it is delivered).
MessageHeaderValueThis property contains the header contents.
OutputFileThe output file.
OutputMessageThe output message after processing.
OverwriteIndicates whether or not the class should overwrite files.
RecipientKeyCountThe number of records in the RecipientKey arrays.
RecipientKeyEncodedThe key.
RecipientKeyKeyringThe location of the keyring.
RecipientKeyUserIdThe user Id of the key.
SignerKeyCountThe number of records in the SignerKey arrays.
SignerKeyEncodedThe key.
SignerKeyKeyringThe location of the keyring.
SignerKeyUserIdThe user Id of the key.
SigningAlgorithmThe 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.
DecryptAndVerifySignatureDecrypts and verifies the signature of the message.
EncryptEncrypts the message.
GetRecipientInfoGets recipient information for an encrypted message.
ResetResets the class properties.
SignSigns the message.
SignAndEncryptSigns and encrypts the current message.
VerifySignatureVerifies 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.

ErrorInformation about errors during data delivery.
KeyPassphraseFired if the passphrase of current key is incorrect or empty.
ProgressFired as progress is made.
RecipientInfoFired for each recipient key of the encrypted message.
SignatureInfoFired during verification of the signed message.
StatusShows the progress of the operation.
VerificationStatusFired 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.
CloseInputStreamAfterProcessingDetermines whether or not the input stream is closed after processing.
CloseOutputStreamAfterProcessingDetermines whether or not the output stream is closed after processing.
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 OpenPGP 2020 Node.js Edition - Version 20.0 [Build 8249]