LibreOffice Module svl (master) 1
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PasswordContainer Class Reference

#include <passwordcontainer.hxx>

Inheritance diagram for PasswordContainer:
[legend]
Collaboration diagram for PasswordContainer:
[legend]

Classes

class  RandomPool
 

Public Member Functions

 PasswordContainer (const css::uno::Reference< css::uno::XComponentContext > &)
 
virtual ~PasswordContainer () override
 
virtual void SAL_CALL add (const OUString &aUrl, const OUString &aUserName, const css::uno::Sequence< OUString > &aPasswords, const css::uno::Reference< css::task::XInteractionHandler > &Handler) override
 
virtual void SAL_CALL addPersistent (const OUString &aUrl, const OUString &aUserName, const css::uno::Sequence< OUString > &aPasswords, const css::uno::Reference< css::task::XInteractionHandler > &Handler) override
 
virtual css::task::UrlRecord SAL_CALL find (const OUString &aUrl, const css::uno::Reference< css::task::XInteractionHandler > &Handler) override
 
virtual css::task::UrlRecord SAL_CALL findForName (const OUString &aUrl, const OUString &aUserName, const css::uno::Reference< css::task::XInteractionHandler > &Handler) override
 
virtual void SAL_CALL remove (const OUString &aUrl, const OUString &aUserName) override
 
virtual void SAL_CALL removePersistent (const OUString &aUrl, const OUString &aUserName) override
 
virtual void SAL_CALL removeAllPersistent () override
 
virtual css::uno::Sequence< css::task::UrlRecord > SAL_CALL getAllPersistent (const css::uno::Reference< css::task::XInteractionHandler > &Handler) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual sal_Bool SAL_CALL authorizateWithMasterPassword (const css::uno::Reference< css::task::XInteractionHandler > &xHandler) override
 
virtual sal_Bool SAL_CALL changeMasterPassword (const css::uno::Reference< css::task::XInteractionHandler > &xHandler) override
 
virtual void SAL_CALL removeMasterPassword () override
 
virtual sal_Bool SAL_CALL hasMasterPassword () override
 
virtual sal_Bool SAL_CALL allowPersistentStoring (sal_Bool bAllow) override
 
virtual sal_Bool SAL_CALL isPersistentStoringAllowed () override
 
virtual sal_Bool SAL_CALL useDefaultMasterPassword (const css::uno::Reference< css::task::XInteractionHandler > &xHandler) override
 
virtual sal_Bool SAL_CALL isDefaultMasterPasswordUsed () override
 
virtual void SAL_CALL addUrl (const OUString &Url, sal_Bool MakePersistent) override
 
virtual OUString SAL_CALL findUrl (const OUString &Url) override
 
virtual void SAL_CALL removeUrl (const OUString &Url) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getUrls (sal_Bool OnlyPersistent) override
 
void Notify ()
 

Private Member Functions

OUString createIV ()
 
css::uno::Sequence< css::task::UserRecord > CopyToUserRecordSequence (const ::std::vector< NamePasswordRecord > &original, const css::uno::Reference< css::task::XInteractionHandler > &Handler)
 
css::task::UserRecord CopyToUserRecord (const NamePasswordRecord &aRecord, bool &io_bTryToDecode, const css::uno::Reference< css::task::XInteractionHandler > &aHandler)
 
css::uno::Sequence< css::task::UserRecord > FindUsr (const ::std::vector< NamePasswordRecord > &userlist, std::u16string_view name, const css::uno::Reference< css::task::XInteractionHandler > &Handler)
 
bool createUrlRecord (const PasswordMap::iterator &rIter, bool bName, std::u16string_view aName, const css::uno::Reference< css::task::XInteractionHandler > &aHandler, css::task::UrlRecord &rRec)
 
css::task::UrlRecord find (const OUString &aURL, std::u16string_view aName, bool bName, const css::uno::Reference< css::task::XInteractionHandler > &aHandler)
 
OUString const & GetMasterPassword (const css::uno::Reference< css::task::XInteractionHandler > &Handler)
 
void UpdateVector (const OUString &url, ::std::vector< NamePasswordRecord > &toUpdate, NamePasswordRecord const &rec, bool writeFile)
 
void PrivateAdd (const OUString &aUrl, const OUString &aUserName, const css::uno::Sequence< OUString > &aPasswords, char aMode, const css::uno::Reference< css::task::XInteractionHandler > &Handler)
 
static ::std::vector< OUString > DecodePasswords (std::u16string_view aLine, std::u16string_view aIV, std::u16string_view aMasterPassword, css::task::PasswordRequestMode mode)
 
void removeAllPersistent (std::unique_lock< std::mutex > &rGuard)
 
void removeMasterPassword (std::unique_lock< std::mutex > &rGuard)
 

Static Private Member Functions

static OUString GetDefaultMasterPassword ()
 
static OUString RequestPasswordFromUser (css::task::PasswordRequestMode aRMode, const css::uno::Reference< css::task::XInteractionHandler > &xHandler)
 
static OUString EncodePasswords (const std::vector< OUString > &lines, std::u16string_view aIV, std::u16string_view aMasterPassword)
 

Private Attributes

PasswordMap m_aContainer
 
std::optional< StorageItemm_xStorageFile
 
std::mutex mMutex
 
OUString m_aMasterPassword
 
css::uno::Reference< css::lang::XComponent > mComponent
 
SysCredentialsConfig mUrlContainer
 
RandomPool mRandomPool
 

Detailed Description

Definition at line 235 of file passwordcontainer.hxx.

Constructor & Destructor Documentation

◆ PasswordContainer()

PasswordContainer::PasswordContainer ( const css::uno::Reference< css::uno::XComponentContext > &  )

Definition at line 376 of file passwordcontainer.cxx.

References m_aContainer, m_xStorageFile, mComponent, and mMutex.

◆ ~PasswordContainer()

PasswordContainer::~PasswordContainer ( )
overridevirtual

Definition at line 390 of file passwordcontainer.cxx.

References m_xStorageFile, mComponent, and mMutex.

Member Function Documentation

◆ add()

void SAL_CALL PasswordContainer::add ( const OUString &  aUrl,
const OUString &  aUserName,
const css::uno::Sequence< OUString > &  aPasswords,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
overridevirtual

Definition at line 638 of file passwordcontainer.cxx.

References MEMORY_RECORD, mMutex, PrivateAdd(), and Url.

◆ addPersistent()

void SAL_CALL PasswordContainer::addPersistent ( const OUString &  aUrl,
const OUString &  aUserName,
const css::uno::Sequence< OUString > &  aPasswords,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
overridevirtual

Definition at line 646 of file passwordcontainer.cxx.

References mMutex, PERSISTENT_RECORD, PrivateAdd(), and Url.

Referenced by changeMasterPassword(), and useDefaultMasterPassword().

◆ addUrl()

void SAL_CALL PasswordContainer::addUrl ( const OUString &  Url,
sal_Bool  MakePersistent 
)
overridevirtual

Definition at line 1309 of file passwordcontainer.cxx.

References SysCredentialsConfig::add(), mUrlContainer, and Url.

◆ allowPersistentStoring()

sal_Bool SAL_CALL PasswordContainer::allowPersistentStoring ( sal_Bool  bAllow)
overridevirtual

Definition at line 1218 of file passwordcontainer.cxx.

References m_xStorageFile, mMutex, and removeMasterPassword().

◆ authorizateWithMasterPassword()

sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword ( const css::uno::Reference< css::task::XInteractionHandler > &  xHandler)
overridevirtual

◆ changeMasterPassword()

sal_Bool SAL_CALL PasswordContainer::changeMasterPassword ( const css::uno::Reference< css::task::XInteractionHandler > &  xHandler)
overridevirtual

◆ CopyToUserRecord()

UserRecord PasswordContainer::CopyToUserRecord ( const NamePasswordRecord aRecord,
bool &  io_bTryToDecode,
const css::uno::Reference< css::task::XInteractionHandler > &  aHandler 
)
private

◆ CopyToUserRecordSequence()

Sequence< UserRecord > PasswordContainer::CopyToUserRecordSequence ( const ::std::vector< NamePasswordRecord > &  original,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 621 of file passwordcontainer.cxx.

References CopyToUserRecord().

Referenced by createUrlRecord().

◆ createIV()

OUString PasswordContainer::createIV ( )
private

◆ createUrlRecord()

bool PasswordContainer::createUrlRecord ( const PasswordMap::iterator &  rIter,
bool  bName,
std::u16string_view  aName,
const css::uno::Reference< css::task::XInteractionHandler > &  aHandler,
css::task::UrlRecord &  rRec 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 734 of file passwordcontainer.cxx.

References aName, CopyToUserRecordSequence(), and FindUsr().

◆ DecodePasswords()

std::vector< OUString > PasswordContainer::DecodePasswords ( std::u16string_view  aLine,
std::u16string_view  aIV,
std::u16string_view  aMasterPassword,
css::task::PasswordRequestMode  mode 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 416 of file passwordcontainer.cxx.

References aSeq, code, getBufFromAsciiLine(), getInfoFromInd(), mode, result, and o3tl::toUInt32().

Referenced by CopyToUserRecord(), getAllPersistent(), and GetMasterPassword().

◆ disposing()

void SAL_CALL PasswordContainer::disposing ( const css::lang::EventObject &  Source)
overridevirtual

Definition at line 403 of file passwordcontainer.cxx.

References m_xStorageFile, mComponent, and mMutex.

◆ EncodePasswords()

OUString PasswordContainer::EncodePasswords ( const std::vector< OUString > &  lines,
std::u16string_view  aIV,
std::u16string_view  aMasterPassword 
)
staticprivate
Exceptions
css::uno::RuntimeException

Definition at line 476 of file passwordcontainer.cxx.

References aSeq, code, createIndex(), getAsciiLine(), OUStringToOString(), result, and o3tl::toUInt32().

Referenced by changeMasterPassword(), GetMasterPassword(), and PrivateAdd().

◆ find() [1/2]

virtual css::task::UrlRecord SAL_CALL PasswordContainer::find ( const OUString &  aUrl,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
overridevirtual

◆ find() [2/2]

css::task::UrlRecord PasswordContainer::find ( const OUString &  aURL,
std::u16string_view  aName,
bool  bName,
const css::uno::Reference< css::task::XInteractionHandler > &  aHandler 
)
private
Exceptions
css::uno::RuntimeException

Referenced by findForName().

◆ findForName()

UrlRecord SAL_CALL PasswordContainer::findForName ( const OUString &  aUrl,
const OUString &  aUserName,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
overridevirtual

Definition at line 711 of file passwordcontainer.cxx.

References aName, aURL, and find().

◆ findUrl()

OUString SAL_CALL PasswordContainer::findUrl ( const OUString &  Url)
overridevirtual

Definition at line 1314 of file passwordcontainer.cxx.

References SysCredentialsConfig::find(), mUrlContainer, and Url.

◆ FindUsr()

Sequence< UserRecord > PasswordContainer::FindUsr ( const ::std::vector< NamePasswordRecord > &  userlist,
std::u16string_view  name,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
private
Exceptions
css::uno::RuntimeException

Definition at line 717 of file passwordcontainer.cxx.

References aName, and CopyToUserRecord().

Referenced by createUrlRecord().

◆ getAllPersistent()

Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent ( const css::uno::Reference< css::task::XInteractionHandler > &  Handler)
overridevirtual

◆ GetDefaultMasterPassword()

OUString PasswordContainer::GetDefaultMasterPassword ( )
staticprivate

Definition at line 807 of file passwordcontainer.cxx.

Referenced by GetMasterPassword(), and useDefaultMasterPassword().

◆ getImplementationName()

OUString SAL_CALL PasswordContainer::getImplementationName ( )
overridevirtual

Definition at line 1371 of file passwordcontainer.cxx.

◆ GetMasterPassword()

OUString const & PasswordContainer::GetMasterPassword ( const css::uno::Reference< css::task::XInteractionHandler > &  Handler)
private

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL PasswordContainer::getSupportedServiceNames ( )
overridevirtual

Definition at line 1381 of file passwordcontainer.cxx.

◆ getUrls()

uno::Sequence< OUString > SAL_CALL PasswordContainer::getUrls ( sal_Bool  OnlyPersistent)
overridevirtual

Definition at line 1324 of file passwordcontainer.cxx.

References SysCredentialsConfig::list(), and mUrlContainer.

◆ hasMasterPassword()

sal_Bool SAL_CALL PasswordContainer::hasMasterPassword ( )
overridevirtual

Definition at line 1207 of file passwordcontainer.cxx.

References m_xStorageFile, and mMutex.

◆ isDefaultMasterPasswordUsed()

sal_Bool SAL_CALL PasswordContainer::isDefaultMasterPasswordUsed ( )
overridevirtual

Definition at line 1297 of file passwordcontainer.cxx.

References m_xStorageFile, and mMutex.

◆ isPersistentStoringAllowed()

sal_Bool SAL_CALL PasswordContainer::isPersistentStoringAllowed ( )
overridevirtual

Definition at line 1235 of file passwordcontainer.cxx.

References m_xStorageFile, and mMutex.

◆ Notify()

void PasswordContainer::Notify ( )

◆ PrivateAdd()

void PasswordContainer::PrivateAdd ( const OUString &  aUrl,
const OUString &  aUserName,
const css::uno::Sequence< OUString > &  aPasswords,
char  aMode,
const css::uno::Reference< css::task::XInteractionHandler > &  Handler 
)
private

◆ remove()

void SAL_CALL PasswordContainer::remove ( const OUString &  aUrl,
const OUString &  aUserName 
)
overridevirtual

Definition at line 922 of file passwordcontainer.cxx.

References aName, aURL, m_aContainer, m_xStorageFile, mMutex, and PERSISTENT_RECORD.

◆ removeAllPersistent() [1/2]

void SAL_CALL PasswordContainer::removeAllPersistent ( )
overridevirtual

Definition at line 1007 of file passwordcontainer.cxx.

References mMutex, and removeAllPersistent().

Referenced by removeAllPersistent(), and removeMasterPassword().

◆ removeAllPersistent() [2/2]

void PasswordContainer::removeAllPersistent ( std::unique_lock< std::mutex > &  rGuard)
private

Definition at line 1013 of file passwordcontainer.cxx.

References m_aContainer, m_xStorageFile, MEMORY_RECORD, and PERSISTENT_RECORD.

◆ removeMasterPassword() [1/2]

void SAL_CALL PasswordContainer::removeMasterPassword ( )
overridevirtual

◆ removeMasterPassword() [2/2]

void PasswordContainer::removeMasterPassword ( std::unique_lock< std::mutex > &  rGuard)
private

Definition at line 1195 of file passwordcontainer.cxx.

References m_aMasterPassword, m_xStorageFile, and removeAllPersistent().

◆ removePersistent()

void SAL_CALL PasswordContainer::removePersistent ( const OUString &  aUrl,
const OUString &  aUserName 
)
overridevirtual

◆ removeUrl()

void SAL_CALL PasswordContainer::removeUrl ( const OUString &  Url)
overridevirtual

Definition at line 1319 of file passwordcontainer.cxx.

References mUrlContainer, SysCredentialsConfig::remove(), and Url.

◆ RequestPasswordFromUser()

OUString PasswordContainer::RequestPasswordFromUser ( css::task::PasswordRequestMode  aRMode,
const css::uno::Reference< css::task::XInteractionHandler > &  xHandler 
)
staticprivate

◆ supportsService()

sal_Bool SAL_CALL PasswordContainer::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 1376 of file passwordcontainer.cxx.

References ServiceName, and cppu::supportsService().

◆ UpdateVector()

void PasswordContainer::UpdateVector ( const OUString &  url,
::std::vector< NamePasswordRecord > &  toUpdate,
NamePasswordRecord const &  rec,
bool  writeFile 
)
private

◆ useDefaultMasterPassword()

sal_Bool SAL_CALL PasswordContainer::useDefaultMasterPassword ( const css::uno::Reference< css::task::XInteractionHandler > &  xHandler)
overridevirtual

Member Data Documentation

◆ m_aContainer

PasswordMap PasswordContainer::m_aContainer
private

◆ m_aMasterPassword

OUString PasswordContainer::m_aMasterPassword
private

◆ m_xStorageFile

std::optional<StorageItem> PasswordContainer::m_xStorageFile
private

◆ mComponent

css::uno::Reference< css::lang::XComponent > PasswordContainer::mComponent
private

◆ mMutex

std::mutex PasswordContainer::mMutex
private

◆ mRandomPool

RandomPool PasswordContainer::mRandomPool
private

Definition at line 267 of file passwordcontainer.hxx.

Referenced by createIV().

◆ mUrlContainer

SysCredentialsConfig PasswordContainer::mUrlContainer
private

Definition at line 246 of file passwordcontainer.hxx.

Referenced by addUrl(), findUrl(), getUrls(), and removeUrl().


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