Discuss this help topic in SecureBlackbox Forum

TElPGPKeyring.FindSecretKeyByID

TElPGPKeyring     See also     


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


Searches secret key in the keyring by its KeyID.

Declaration

[C#/Java]
    int FindSecretKeyByID(byte[] KeyID, ref TElPGPCustomSecretKey Res, int StartIndex /* = 0 */);
    int FindSecretKeyByID(string KeyID, ref TElPGPCustomSecretKey Res, int StartIndex /* = 0 */);

[VB.NET]
    Function FindSecretKeyByID(ByVal KeyID As Byte(), ByRef Res As TElPGPCustomSecretKey, ByVal StartIndex As Integer = 0) As Integer
    Function FindSecretKeyByID(ByVal KeyID As String, ByRef Res As TElPGPCustomSecretKey, ByVal StartIndex As Integer = 0) As Integer

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

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

[PHP]
    integer FindSecretKeyByID(TSBKeyID $KeyID, TElPGPCustomSecretKey &$Res, integer $StartIndex)
    integer FindSecretKeyByID(string $KeyID, TElPGPCustomSecretKey &$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

    The total number of keys with the specified KeyID

Description

    Use this method when you need to find 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:     AddSecretKey     FindPublictKeyByEmailAddress     FindPublicKeyByID     FindSecretKeyByEmailAddress     RemoveSecretKey     Clear     Load     Save     SecretCount     SecretKeys    

Discuss this help topic in SecureBlackbox Forum