Passwordfile library 5.2.0
C++ library to read/write passwords from/to encrypted files
Loading...
Searching...
No Matches
Io Namespace Reference

Contains all IO related classes. More...

Classes

class  CryptoException
 The exception that is thrown when an encryption/decryption error occurs. More...
struct  EntryStatistics
class  Entry
 Instances of the Entry class form a hierarchic data structure used to store account information. More...
class  NodeEntry
 The NodeEntry class acts as parent for other entries. More...
class  AccountEntry
 The exception that is thrown when a parsing error occurs. More...
class  Field
 The Field class holds field information which consists of a name and a value and is able to serialize and deserialize this information. More...
class  ParsingException
 The exception that is thrown when a parsing error occurs. More...
class  PasswordFile
 The PasswordFile class holds account information in the form of Entry and Field instances and provides methods to read and write these information to encrypted files using OpenSSL. More...

Enumerations

enum class  EntryType : int { Node , Account }
 Specifies the entry type. More...
enum class  FieldType : int { Normal , Password }
enum class  PasswordFileOpenFlags : std::uint64_t { None = 0 , ReadOnly = (1 << 0) , New = (1 << 1) , Default = None }
enum class  PasswordFileSaveFlags : std::uint64_t {
  None = 0 , Encryption = (1 << 0) , Compression = (1 << 1) , PasswordHashing = (1 << 2) ,
  AllowToCreateNewFile = (1 << 3) , AuthenticationTag = (1 << 4) , Default = Encryption | Compression | PasswordHashing | AllowToCreateNewFile | AuthenticationTag
}
enum class  ExtendedHeaderFieldIds : std::uint32_t { AuthTag = 0x686D6163U }

Functions

PASSWORD_FILE_EXPORT std::string flagsToString (PasswordFileOpenFlags flags)
 Returns a comma-separated string for the specified flags.
PASSWORD_FILE_EXPORT std::string flagsToString (PasswordFileSaveFlags flags)
 Returns a comma-separated string for the specified flags.

Variables

constexpr auto aes256cbcIvSize = 16U
constexpr auto aes256blockSize = 32U
constexpr auto aes256additionalBufferSize = aes256blockSize * 2U
constexpr auto authTagSize = Util::OpenSsl::Sha256Sum::size
constexpr auto extendedHeaderFieldIdSize = sizeof(std::underlying_type<ExtendedHeaderFieldIds>::type)
constexpr auto extendedAuthTagSize = extendedHeaderFieldIdSize + authTagSize

Detailed Description

Contains all IO related classes.

Enumeration Type Documentation

◆ EntryType

enum class Io::EntryType : int
strong

Specifies the entry type.

Enumerator
Node 

denotes a NodeEntry

Account 

denotes an AccountEntry

Definition at line 17 of file entry.h.

◆ ExtendedHeaderFieldIds

enum class Io::ExtendedHeaderFieldIds : std::uint32_t
strong
Enumerator
AuthTag 

Definition at line 39 of file passwordfile.cpp.

◆ FieldType

enum class Io::FieldType : int
strong
Enumerator
Normal 
Password 

Definition at line 11 of file field.h.

◆ PasswordFileOpenFlags

enum class Io::PasswordFileOpenFlags : std::uint64_t
strong
Enumerator
None 

none of the optional behavior is enabled, open the file in read-write mode

ReadOnly 

open the file in read-only mode

New 

a new file is created and PasswordFileOpenFlags::ReadOnly ignored

Default 

default behavior, open the file in read-write mode

Definition at line 19 of file passwordfile.h.

◆ PasswordFileSaveFlags

enum class Io::PasswordFileSaveFlags : std::uint64_t
strong
Enumerator
None 

none of the optional behavior is enabled

Encryption 

enable encryption

Compression 

enable compression

PasswordHashing 

enable password hashing

AllowToCreateNewFile 

create a new file if the file does not exist

AuthenticationTag 

add an HMAC-SHA256 authentication code

Default 

default behavior for storing data encrypted in the most secure and efficient way

Definition at line 28 of file passwordfile.h.

Function Documentation

◆ flagsToString() [1/2]

string Io::flagsToString ( PasswordFileOpenFlags flags)

Returns a comma-separated string for the specified flags.

Definition at line 875 of file passwordfile.cpp.

◆ flagsToString() [2/2]

string Io::flagsToString ( PasswordFileSaveFlags flags)

Returns a comma-separated string for the specified flags.

Definition at line 890 of file passwordfile.cpp.

Variable Documentation

◆ aes256additionalBufferSize

auto Io::aes256additionalBufferSize = aes256blockSize * 2U
constexpr

Definition at line 37 of file passwordfile.cpp.

◆ aes256blockSize

auto Io::aes256blockSize = 32U
constexpr

Definition at line 36 of file passwordfile.cpp.

◆ aes256cbcIvSize

auto Io::aes256cbcIvSize = 16U
constexpr

Definition at line 35 of file passwordfile.cpp.

◆ authTagSize

auto Io::authTagSize = Util::OpenSsl::Sha256Sum::size
constexpr

Definition at line 43 of file passwordfile.cpp.

◆ extendedAuthTagSize

auto Io::extendedAuthTagSize = extendedHeaderFieldIdSize + authTagSize
constexpr

Definition at line 45 of file passwordfile.cpp.

◆ extendedHeaderFieldIdSize

auto Io::extendedHeaderFieldIdSize = sizeof(std::underlying_type<ExtendedHeaderFieldIds>::type)
constexpr

Definition at line 44 of file passwordfile.cpp.