Exports private key from this OpenPGP key store as a String in ASCII armored format.

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

Syntax

C#
public virtual string ExportPrivateKeyAsString(
	string userId
)
Visual Basic (Declaration)
Public Overridable Function ExportPrivateKeyAsString ( _
	userId As String _
) As String
Visual C++
public:
virtual String^ ExportPrivateKeyAsString(
	String^ userId
)

Parameters

userId
Type: System..::.String
User Id of the form "name (comment) <email address>"

Return Value

requested Private key in ASCII armored format

Examples

CopyC#
using System;
using DidiSoft;

public class ExportKeys
{
   public void Demo()
   {
       KeyStore ks = new KeyStore(@"C:\Test\key.store", "changeit");
       String keyAscii = ks.ExportPrivateKeyAsString("support@didisoft.com");
   }
}
CopyVB.NET
Imports System
Imports DidiSoft

Public Class ExportKeys
   Public Sub Demo()
       Dim ks As New KeyStore("C:\Test\key.store", "changeit")
       String keyAscii = ks.ExportPrivateKeyAsString("support@didisoft.com")
   End Sub
End Class

Exceptions

ExceptionCondition
PgpExceptionIf there is no such key

See Also