Checks is there a key with the specified User Id in this Key Store

Namespace: DidiSoft.Pgp
Assembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547

Syntax

C#
public bool ContainsKey(
	string userId
)
Visual Basic
Public Function ContainsKey ( _
	userId As String _
) As Boolean
Visual C++
public:
bool ContainsKey(
	String^ userId
)

Parameters

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

Return Value

Returns true if this key store contains key with the specified User Id

Examples

CopyC#
using System;
using DidiSoft.Pgp;

public class ContainsKey
{
   public void Demo()            
   {
       KeyStore ks = new KeyStore(@"DataFiles\key.store", "changeit");
       String userId = "support@didisoft.com";
       if (ks.ContainsKey(userId))
       {
           Console.WriteLine("Key found.");
       }
   }
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp

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

See Also