OpenPGP Signs file.
Namespace:
DidiSoftAssembly: PGPLib (in PGPLib.dll) Version: 1.6.3.19546
Syntax
| C# |
|---|
public void SignFile( string fileName, string privateKeyFileName, string privateKeyPassword, string signedFileName, bool asciiArmor ) |
| Visual Basic (Declaration) |
|---|
Public Sub SignFile ( _ fileName As String, _ privateKeyFileName As String, _ privateKeyPassword As String, _ signedFileName As String, _ asciiArmor As Boolean _ ) |
| Visual C++ |
|---|
public: void SignFile( String^ fileName, String^ privateKeyFileName, String^ privateKeyPassword, String^ signedFileName, bool asciiArmor ) |
Parameters
- fileName
- Type: System..::.String
File Name to be OpenPGP Signed (absolute or relative path)
- privateKeyFileName
- Type: System..::.String
Private Key file (absolute or relative path)
- privateKeyPassword
- Type: System..::.String
Private key password
- signedFileName
- Type: System..::.String
File name of the OpenPGP signed file (absolute or relative path)
- asciiArmor
- Type: System..::.Boolean
if true, output file is in ASCII armored format
Examples
This sample shows how to sign file using private key located in file
CopyC#
CopyVB.NET
using System; using DidiSoft; public class SignDemo { public void Demo() { PGPLib pgp = new PGPLib(); bool armor = true; pgp.SignFile(@"C:\Test\INPUT.txt", @"C:\Test\private.pkr", "changeit", @"C:\Test\OUTPUT1.pgp", armor); } }
Imports System Imports DidiSoft Public Class SignDemo Public Sub Demo() Dim pgp As New PGPLib() Dim armor As Boolean = True pgp.SignFile("C:\Test\INPUT.txt", "C:\Test\private.key", "changeit", "C:\Test\OUTPUT1.signed", armor) End Sub End Class
Exceptions
| Exception | Condition |
|---|---|
| PgpException | if an error has occured |
| System.IO..::.IOException | if an IO problem has occured |