IPWorks OpenPGP 2020 C++ Edition

Questions / Feedback?

SetInputStream Method

Sets the stream from which the class will read data to encrypt or decrypt.

Syntax

ANSI (Cross Platform)
int SetInputStream(IPWorksOpenPGPStream* sInputStream);

Unicode (Windows)
INT SetInputStream(IPWorksOpenPGPStream* sInputStream);
#define MID_OPENPGP_SETINPUTSTREAM 8

IPWORKSOPENPGP_EXTERNAL int IPWORKSOPENPGP_CALL IPWorksOpenPGP_OpenPGP_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method sets the stream from which the class will read data to encrypt or decrypt. If an input stream is set before the class attempts to encode or decode an OpenPGP message, the data is read from the input stream instead of from the InputFile or InputMessage properties.

Encrypt and/or Sign

You can call this method to set the input stream that you would like to sign and/or encrypt. Then call Sign, Encrypt, or SignAndEncrypt to sign and/or encrypt the message. The appropriate ASCII Armor headers will be generated in MessageHeaders.

Decrypt and/or Verify

You can call this method to specify a valid input stream that contains the signed and/or encrypted data you would like to verify or decrypt. Then call VerifySignature, Decrypt, or DecryptAndVerifySignature to verify and/or decrypt the message.

The content of the stream will be read from the current position all the way to the end and no bytes will be skipped.

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:

When using streams you may need to additionally set CloseInputStreamAfterProcessing or CloseOutputStreamAfterProcessing.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks OpenPGP 2020 C++ Edition - Version 20.0 [Build 8249]