![]() |
NDEVR
API Documentation
|
When passwords are used inside the NDEVR engine, we don't want them logged or visible. More...
Public Types | |
| enum class | Strength { e_very_weak , e_weak , e_moderate , e_strong , e_very_strong } |
| Enumeration representing the strength level of a password. More... | |
Public Member Functions | |
| PasswordString () | |
| Creates an empty password string. | |
| char * | begin () |
| Returns a mutable pointer to the beginning of the encoded password data. | |
| const char * | begin () const |
| Returns a const pointer to the beginning of the encoded password data. | |
| void | clear () |
| Clears the encoded password data. | |
| String | decode () const |
| Decodes using the system default key which will only be valid for this software session. | |
| String | decode (const StringView &key) const |
| Decodes using a specific key, in case passwords should be retrievable across sessions. | |
| bool | isEmpty () |
| Checks whether the encoded password is empty. | |
| bool | operator!= (const PasswordString &passcode) const |
| Checks whether two password strings are not equal. | |
| bool | operator== (const PasswordString &passcode) const |
| Checks whether two password strings are equal. | |
| Strength | passwordStrength (const StringView &key) const |
| Evaluates the strength of the decoded password. | |
| uint04 | size () const |
| Returns the size of the encoded password string. | |
| void | swapEncoding (const StringView ¤t_key, const StringView &new_key) |
| Changes the encoding from one key to another. | |
Static Public Member Functions | |
| static PasswordString | Encode (const StringView &input) |
| Encodes using the session default key which will only be valid for this software session. | |
| static PasswordString | Encode (const StringView &input, const StringView &key) |
| Encodes using a specific key, in case passwords should be retrievable across sessions. | |
| static PasswordString | FromString (const StringView &value) |
| Takes the value without doing any encoding or decoding. | |
| static PasswordString | RAW (const StringView &value) |
| Takes the value without doing any encoding or decoding. | |
When passwords are used inside the NDEVR engine, we don't want them logged or visible.
Passwords should be placed into this struct immediately on user input.
Definition at line 15 of file PasswordString.h.
|
strong |
Enumeration representing the strength level of a password.
| Enumerator | |
|---|---|
| e_very_weak | Password is very weak and easily guessable. |
| e_weak | Password is weak and offers minimal security. |
| e_moderate | Password has moderate strength. |
| e_strong | Password is strong and reasonably secure. |
| e_very_strong | Password is very strong and highly secure. |
Definition at line 21 of file PasswordString.h.
|
inline |
Returns a mutable pointer to the beginning of the encoded password data.
Definition at line 39 of file PasswordString.h.
|
inline |
Returns a const pointer to the beginning of the encoded password data.
Definition at line 34 of file PasswordString.h.
| String PasswordString::decode | ( | ) | const |
Decodes using the system default key which will only be valid for this software session.
Ergo, you can't decode something from a previous session.
| String PasswordString::decode | ( | const StringView & | key | ) | const |
Decodes using a specific key, in case passwords should be retrievable across sessions.
| [in] | key | The current key used to decode the password. If empty, decode() will be called. |
|
static |
Encodes using the session default key which will only be valid for this software session.
| [in] | input | The input password that will be encoded |
References PasswordString().
|
static |
Encodes using a specific key, in case passwords should be retrievable across sessions.
| [in] | input | The input password that will be encoded |
| [in] | key | If empty, the session default key will be used. |
References PasswordString().
|
static |
Takes the value without doing any encoding or decoding.
| [in] | value | the raw, password encoded string. |
References PasswordString().
|
inline |
Checks whether the encoded password is empty.
Definition at line 53 of file PasswordString.h.
| bool PasswordString::operator!= | ( | const PasswordString & | passcode | ) | const |
Checks whether two password strings are not equal.
| [in] | passcode | The other PasswordString to compare against. |
References PasswordString().
| bool PasswordString::operator== | ( | const PasswordString & | passcode | ) | const |
Checks whether two password strings are equal.
| [in] | passcode | The other PasswordString to compare against. |
References PasswordString().
| Strength PasswordString::passwordStrength | ( | const StringView & | key | ) | const |
Evaluates the strength of the decoded password.
| [in] | key | The key used to decode the password before evaluating strength. |
|
static |
Takes the value without doing any encoding or decoding.
| [in] | value | the raw, password encoded string. |
References PasswordString().
|
inline |
Returns the size of the encoded password string.
Definition at line 44 of file PasswordString.h.
| void PasswordString::swapEncoding | ( | const StringView & | current_key, |
| const StringView & | new_key ) |
Changes the encoding from one key to another.
Useful for converting passwords to a usable form without ever revealing the raw password.
| [in] | current_key | The current key used to encode the password. If empty, the session default will be used |
| [in] | new_key | The key to use as the new encoding. If empty, the session default will be used. |