Home GnuPG

Try to fill out name and email for new key on win

Description

Try to fill out name and email for new key on win

Under Windows we usually cannot rely on KEMailSettings so
we add a fallback that uses GetUserNameEx to query the
name and email through Windows API. This respects Active
Directory setups in most institutions and could in theory
be used to automate key generation.

Details

Provenance
aheineckeAuthored on Dec 16 2020, 3:23 PM
Parents
rKLEOPATRA377faf15c2d8: Remove overviewpage from newkeywizard
Branches
Unknown
Tags
Unknown
Tasks
T5181: Kleopatra: Simplify newkey generation

Event Timeline

I would prefer platform-specific code (i.e. the function win_get_user_name) to be put in separate .cpp files (e.g. newcertificatewizard_win.cpp). In fact, there should probably be helpers defaultFullName() and defaultEmailAddress() with platform-specific implementations, so that the using code doesn't need any #ifdef <platform>.

Ok. I've just added with rev 69539cea316f2d2998eefbd14539f8def3fc07ab more platform specific code for userinformation so this makes even more sense.