Exports public key from this OpenPGP key store, into file.

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

Syntax

C#
public virtual void ExportPublicKey(
	string fileName,
	string userId,
	bool asciiArmored
)
Visual Basic (Declaration)
Public Overridable Sub ExportPublicKey ( _
	fileName As String, _
	userId As String, _
	asciiArmored As Boolean _
)
Visual C++
public:
virtual void ExportPublicKey(
	String^ fileName, 
	String^ userId, 
	bool asciiArmored
)

Parameters

fileName
Type: System..::.String
File name where the public key will be exported (absolute or relative path)
userId
Type: System..::.String
User Id of the form "name (comment) <email address>"
asciiArmored
Type: System..::.Boolean
If true, output is in ASCII armored format

Remarks

Exports public key from this OpenPGP key store, into file.

Examples

CopyC#
using System;
using DidiSoft;

public class ExportKeys
{
   public void Demo()
   {
       KeyStore ks = new KeyStore(@"C:\Test\key.store", "changeit");
       bool asciiArmored = true;
       ks.ExportPublicKey(@"C:\Test\public_key_exported.pkr", "support@didisoft.com", asciiArmored);
   }
}
CopyVB.NET
Imports System
Imports DidiSoft

Public Class ExportKeys
   Public Sub Demo()
       Dim ks As New KeyStore("C:\Test\key.store", "changeit")
       Dim asciiArmored As Boolean = True
       ks.ExportPublicKey("C:\Test\public_key_exported.pkr", "support@didisoft.com", asciiArmored)
   End Sub
End Class

Exceptions

ExceptionCondition
PgpExceptionIf there is no such key
System.IO..::.IOExceptionIf file writing error occur

See Also