SecureBlackbox 2020 C++ Edition

Questions / Feedback?

KeyPassphraseNeeded Event

Requests a key protection password from the application.

Syntax

ANSI (Cross Platform)
virtual int FireKeyPassphraseNeeded(PGPReaderKeyPassphraseNeededEventParams *e);
typedef struct {
const char *KeyID;
const char *UserID;
int MainKey;
char *Passphrase;
int Skip; int reserved; } PGPReaderKeyPassphraseNeededEventParams; Unicode (Windows) virtual INT FireKeyPassphraseNeeded(PGPReaderKeyPassphraseNeededEventParams *e);
typedef struct {
LPCWSTR KeyID;
LPCWSTR UserID;
BOOL MainKey;
LPWSTR Passphrase;
BOOL Skip; INT reserved; } PGPReaderKeyPassphraseNeededEventParams;
- (void)onKeyPassphraseNeeded:(NSString*)keyID :(NSString*)userID :(BOOL)mainKey :(NSString**)passphrase :(int*)skip;
#define EID_PGPREADER_KEYPASSPHRASENEEDED 5

virtual INT SECUREBLACKBOX_CALL FireKeyPassphraseNeeded(LPSTR &lpszKeyID, LPSTR &lpszUserID, BOOL &bMainKey, LPSTR &lpszPassphrase, BOOL &bSkip);

Remarks

The class fires this event to request a secret key passphrase from the application. Note that this event asks for a key protection passphrase rather than a message protection passphrase (which is requested via PassphraseNeeded). The class fires it when it has found a suitable decryption secret key in the keyring, and attempts to use it to decrypt the data.

If the data is encrypted with multiple keys, this event is called for each key in a loop until the password for at least one key is provided correctly. KeyID specifies the key for which the password is requested, and UserID identifies its user. MainKey tells whether the key is a master key or a subkey.

The handler should provide password via the Passphrase parameter, or set Skip to True to skip this key.

For each key KeyPassphraseNeeded is called in a loop until the correct password is provided or the maximum number of password attempts reached.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 C++ Edition - Version 20.0 [Build 8166]