Function CryptoGetTextPassword

Synopsis

#include <include/extractcallback.hpp>

STDMETHOD() CryptoGetTextPassword(BSTR *aPassword)

Description

ICryptoGetTextPassword.

Source

Lines 75-94 in src/extractcallback.cpp. Line 51 in include/extractcallback.hpp.

STDMETHODIMP ExtractCallback::CryptoGetTextPassword( BSTR* password ) {
    wstring pass;
    if ( !mHandler.isPasswordDefined() ) {
        // You can ask real password here from user
        // Password = GetPassword(OutStream);
        // PasswordIsDefined = true;
        if ( mHandler.passwordCallback() ) {
            pass = mHandler.passwordCallback()();
        }

        if ( pass.empty() ) {
            mErrorMessage = L"Password is not defined";
            return E_FAIL;
        }
    } else {
        pass = mHandler.password();
    }

    return StringToBstr( pass.c_str(), password );
}





Add Discussion as Guest

Log in