Exports private key from this OpenPGP key store as a byte array
Namespace: DidiSoft.PgpAssembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
| C# |
|---|
public virtual byte[] ExportPrivateKeyBytes(
string userId
) |
| Visual Basic |
|---|
Public Overridable Function ExportPrivateKeyBytes ( _
userId As String _
) As Byte() |
Parameters
- userId
- Type: System..::..String
User Id of the form "name (comment) <email address>"
Return Value
requested Private key as byte array
Examples
CopyC#
using System;
using DidiSoft.Pgp;
public class ExportKeyBytes
{
public void Demo()
{
KeyStore ks = new KeyStore(@"C:\Test\key.store", "changeit");
byte[] keyBytes = ks.ExportPrivateKeyBytes("support@didisoft.com");
}
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp
Public Class ExportKeyBytes
Public Sub Demo()
Dim ks As New KeyStore("C:\Test\key.store", "changeit")
Dim keyAscii As Byte() = ks.ExportPrivateKeyBytes("support@didisoft.com")
End Sub
End Class
Exceptions
See Also