Botan 1.10.17
Botan::User_Interface Class Reference

#include <ui.h>

Public Types

enum  UI_Result { OK , CANCEL_ACTION }

Public Member Functions

virtual std::string get_passphrase (const std::string &, const std::string &, UI_Result &) const
 User_Interface (const std::string &="")
virtual ~User_Interface ()

Protected Attributes

bool first_try
std::string preset_passphrase

Detailed Description

User Interface Only really used for callbacks for PKCS #8 decryption

Definition at line 20 of file ui.h.

Member Enumeration Documentation

◆ UI_Result

Enumerator
OK 
CANCEL_ACTION 

Definition at line 23 of file ui.h.

Constructor & Destructor Documentation

◆ User_Interface()

Botan::User_Interface::User_Interface ( const std::string & preset = "")

Definition at line 30 of file ui.cpp.

30 :
31 preset_passphrase(preset)
32 {
33 first_try = true;
34 }
std::string preset_passphrase
Definition ui.h:31

References first_try, and preset_passphrase.

Referenced by Botan::PKCS8::load_key(), and Botan::PKCS8::load_key().

◆ ~User_Interface()

virtual Botan::User_Interface::~User_Interface ( )
inlinevirtual

Definition at line 29 of file ui.h.

29{}

Member Function Documentation

◆ get_passphrase()

std::string Botan::User_Interface::get_passphrase ( const std::string & ,
const std::string & ,
UI_Result & action ) const
virtual

Definition at line 15 of file ui.cpp.

18 {
19 action = OK;
20
21 if(!first_try)
22 action = CANCEL_ACTION;
23
24 return preset_passphrase;
25 }

References CANCEL_ACTION, first_try, OK, and preset_passphrase.

Member Data Documentation

◆ first_try

bool Botan::User_Interface::first_try
mutableprotected

Definition at line 32 of file ui.h.

Referenced by get_passphrase(), and User_Interface().

◆ preset_passphrase

std::string Botan::User_Interface::preset_passphrase
protected

Definition at line 31 of file ui.h.

Referenced by get_passphrase(), and User_Interface().


The documentation for this class was generated from the following files: