Imports and OpenPGP private key into a custom OpenPGP key store.
Namespace: DidiSoft.PgpAssembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
Parameters
- privateKeyFileName
- Type: System..::..String
File of the Private key to be imported (absolute or relative path)
Return Value
A
KeyPairInformation object representing the imported private key
Remarks
Examples
CopyC#
using System;
using DidiSoft.Pgp;
public class ImportPrivateKey
{
public static void Demo()
{
KeyStore keyStore = new KeyStore(@"DataFiles\key.store", "changeit");
KeyPairInformation key = keyStore.ImportPrivateKey(@"private_key.asc");
}
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp
Public Class ImportPrivateKey
Public Shared Sub Demo()
Dim keyStore As New KeyStore("DataFiles\key.store", "changeit")
Dim key As KeyPairInformation = keyStore.ImportPrivateKey("private_key.asc")
End Sub
End Class
Exceptions
See Also