Discuss this help topic in SecureBlackbox Forum


TElPGPDecryptingStream     See also     

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

This event is fired when a password for the key is required.


    event TSBPGPKeyPassphraseEvent OnKeyPassphrase;
    delegate void TSBPGPKeyPassphraseEvent(Object Sender, TElPGPCustomSecretKey Key, ref string Passphrase, ref bool Cancel);

    Event OnKeyPassphrase As TSBPGPKeyPassphraseEvent
    Delegate Sub TSBPGPKeyPassphraseEvent(ByVal Sender As Object, ByVal Key As TElPGPCustomSecretKey, ByRef Passphrase As String, ByRef Cancel As Boolean)

    property OnKeyPassphrase : TSBPGPKeyPassphraseEvent;
    TSBPGPKeyPassphraseEvent = procedure(Sender: TObject; Key : TElPGPCustomSecretKey; var Passphrase: string; var Cancel: boolean) of object;

    void get_OnKeyPassphrase(TSBPGPKeyPassphraseEvent &pMethodOutResult, void * &pDataOutResult);
    void set_OnKeyPassphrase(TSBPGPKeyPassphraseEvent pMethodValue, void * pDataValue);
    typedef void (SB_CALLBACK *TSBPGPKeyPassphraseEvent)(void * _ObjectData, TObjectHandle Sender, TElPGPCustomSecretKeyHandle Key, char * pcPassphrase, int32_t &szPassphrase, int8_t &Cancel);

    TSBPGPKeyPassphraseEvent|callable|NULL get_OnKeyPassphrase()
    void set_OnKeyPassphrase(TSBPGPKeyPassphraseEvent|callable|NULL $Value)
    callable TSBPGPKeyPassphraseEvent(TObject $Sender, TElPGPCustomSecretKey $Key, string &$Passphrase, bool &$Cancel)

    TSBPGPKeyPassphraseEvent getOnKeyPassphrase();
    void setOnKeyPassphrase(TSBPGPKeyPassphraseEvent Value);
    TSBPGPKeyPassphraseEvent.Callback OnKeyPassphrase = new TSBPGPKeyPassphraseEvent.Callback() {
        public void TSBPGPKeyPassphraseEventCallback(TObject Sender, TElPGPCustomSecretKey Key, TSBString Passphrase, TSBBoolean Cancel) {


  • Key - key which needs password.
  • Passphrase - password.
  • Cancel - True if the password can't be provided and processing must be cancelled.
  • pcPassphrase - password.
  • szPassphrase - the length of pcPassphrase.


    This event is fired by TElPGPDecryptingStream when it needs a password to access a secret key. The event is fired until correct password is passed or Cancel parameter is set to True.
    If the data contains multiple keys, OnKeyPassphrase is called for each key in a loop until the password for some key is provided correctly. For each key OnKeyPassphrase is called in a loop until the password is provided correctly or Cancel is set to True. If the password is provided correctly, then both loops are stopped and the key for which the password has been provided is used. If Cancel is set to True, OnKeyPassphrase is not called for the particular key, and processing advances to the next key.

See also:     OnKeyIDs     OnPassphrase    

Discuss this help topic in SecureBlackbox Forum