Discuss this help topic in SecureBlackbox Forum

TElPGPKeyring.FindPublicKeyByID

TElPGPKeyring     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


Searches public key in the keyring by its KeyID.

Declaration

[C#/Java]
    int FindPublicKeyByID(byte[] KeyID, ref TElPGPCustomPublicKey Res, int StartIndex);
    int FindPublicKeyByID(string KeyID, ref TElPGPCustomPublicKey Res, int StartIndex);

[VB.NET]
    Function FindPublicKeyByID(ByVal KeyID As Byte(), ByRef Res As TElPGPCustomPublicKey, ByVal StartIndex As Integer) As Integer
    Function FindPublicKeyByID(ByVal KeyID As String, ByRef Res As TElPGPCustomPublicKey, ByVal StartIndex As Integer) As Integer

[Pascal]
    Function FindPublicKeyByID(KeyID : TSBKeyID; var Res : TElPGPCustomPublicKey; StartIndex : integer = 0) : integer;
    TSBKeyID = array[0..7] of byte;
    Function FindPublicKeyByID(KeyID : string; var Res : TElPGPCustomPublicKey; StartIndex : integer = 0) : integer;

[C++]
    int32_t FindPublicKeyByID(const TSBKeyID &KeyID, TElPGPCustomPublicKey &Res, int32_t StartIndex);
    int32_t FindPublicKeyByID(const std::string &KeyID, TElPGPCustomPublicKey &Res, int32_t StartIndex);

[PHP]
    integer FindPublicKeyByID(TSBKeyID $KeyID, TElPGPCustomPublicKey &$Res, integer $StartIndex)
    integer FindPublicKeyByID(string $KeyID, TElPGPCustomPublicKey &$Res, integer $StartIndex)

Parameters

  • KeyID - the value of KeyID method of the key being searched for. Alternatively a textual representation of the key ID (see Description below).
  • Res - the resulting key (if one was found)
  • StartIndex - StartIndex'th key with given ID will be retrieved.

Return value

    Total number of keys with the specified KeyID

Description

    Use this method when you need to find a public key with specified KeyID.

    Note, that KeyIDs are not globally unique, i.e. different keys can share the same ID. So you need to check that the key found is the one you've searched for, and if no, pass other value to the StartIndex parameter. StartIndex must be in range of 0 (retrieve the very first key) and the number of keys with the given ID less 1.

    String form of KeyID can be 0x12345678 or 12345678 (short form, 4 base16-encoded bytes) or 0x123456789ABCDEF0 or 123456789ABCDEF0 (complete form, 8 base16-encoded bytes). The method will try to match whatever was provided to the actual key ID.

See also:     AddPublicKey     FindPublictKeyByEmailAddress     FindSecretKeyByEmailAddress     FindSecretKeyByID     RemovePublicKey     Clear     Load     Save     PublicCount     PublicKeys    

Discuss this help topic in SecureBlackbox Forum