OpenPGP Signs and encrypts given file with supplied public and private key

Namespace:  DidiSoft
Assembly:  PGPLib (in PGPLib.dll) Version: 1.6.3.19546

Syntax

C#
public void SignAndEncryptFile(
	string actualFileName,
	string embeddedFileName,
	Stream privateKeyStream,
	string privateKeyPassword,
	Stream publicKeyStream,
	Stream outputStream,
	bool armor,
	bool withIntegrityCheck
)
Visual Basic (Declaration)
Public Sub SignAndEncryptFile ( _
	actualFileName As String, _
	embeddedFileName As String, _
	privateKeyStream As Stream, _
	privateKeyPassword As String, _
	publicKeyStream As Stream, _
	outputStream As Stream, _
	armor As Boolean, _
	withIntegrityCheck As Boolean _
)
Visual C++
public:
void SignAndEncryptFile(
	String^ actualFileName, 
	String^ embeddedFileName, 
	Stream^ privateKeyStream, 
	String^ privateKeyPassword, 
	Stream^ publicKeyStream, 
	Stream^ outputStream, 
	bool armor, 
	bool withIntegrityCheck
)

Parameters

actualFileName
Type: System..::.String
File Name to be PGP Signed (absolute or relative path)
embeddedFileName
Type: System..::.String
File Name to be stored in the PGP archive
privateKeyStream
Type: System.IO..::.Stream
Private Key as stream, used for signing
privateKeyPassword
Type: System..::.String
Private key password
publicKeyStream
Type: System.IO..::.Stream
Public key as stream, used for encryption
outputStream
Type: System.IO..::.Stream
Ouput stream of the PGP Signed file
armor
Type: System..::.Boolean
if true, output file is in ASCII armored format
withIntegrityCheck
Type: System..::.Boolean
Should integrity check be added to the file.

Remarks

* (Note that this is not the same as first encrypt and then sign a file, because in that case a double compressing is performed.)
Compression algorithm used is the one specified through Compression
Symmetric cipher algorithm used is the one specified through Cypher

Exceptions

ExceptionCondition
PgpExceptionif an error has occured
System.IO..::.IOExceptionif a problem has reading input file or private key file

See Also