Returns true if key with the specified Key ID exists in this Key Store

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

Syntax

C#
public bool ContainsKey(
	long keyId
)
Visual Basic (Declaration)
Public Function ContainsKey ( _
	keyId As Long _
) As Boolean
Visual C++
public:
bool ContainsKey(
	long long keyId
)

Parameters

keyId
Type: System..::.Int64
Key Id of type Int64

Return Value

Returns true if this key store contains key with the specified Key ID

Examples

CopyC#
using System;
using DidiSoft;

public class GenerateKeyPair
{
   public void Demo()            
   {
       KeyStore ks = new KeyStore(@"DataFiles\key.store", "changeit");
       long keyId = 10000;
       if (ks.ContainsKey(userId))
       {
           Console.WriteLine("Key found.");
       }
   }
}
CopyVB.NET
Imports System
Imports DidiSoft

Public Class GenerateKeyPair
   Public Sub Test()
       Dim ks As New KeyStore("DataFiles\key.store", "changeit")
       If (Not ks.ContainsKey(1000)) Then
           Console.WriteLine("Key found.")
       End If
   End Sub
End Class

Exceptions

ExceptionCondition
PgpException

See Also