Imports Public key into a custom OpenPGP key store. If the key store does not exist, it is created.
Namespace: DidiSoft.PgpAssembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
Parameters
- publicKeyFileName
- Type: System..::..String
FileName of the Public key to be imported (absolute or relative path)
Return Value
A
KeyPairInformation representing the imported public key
Examples
CopyC#
using System;
using DidiSoft.Pgp;
public class ImportPublicKey
{
public static void Demo()
{
KeyStore keyStore = new KeyStore(@"DataFiles\key.store", "changeit");
KeyPairInformation key = keyStore.ImportPublicKey(@"public_key.asc");
}
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp
Public Class ImportPublicKey
Public Shared Sub Demo()
Dim keyStore As New KeyStore("DataFiles\key.store", "changeit")
Dim key As KeyPairInformation = keyStore.ImportPublicKey("public_key.asc")
End Sub
End Class
Exceptions
See Also