libkazv
Kazv::EncryptedFileDesc Class Reference

#include <encrypted-file.hpp>

Classes

struct  Private
 

Public Member Functions

 EncryptedFileDesc ()
 Constructs an empty EncryptedFileDesc. More...
 
 EncryptedFileDesc (std::string mxcUri, std::string key, std::string iv, std::string sha256Hash)
 Constructs an EncryptedFileDesc from mxcUri, key, iv and sha256Hash. More...
 
 ~EncryptedFileDesc ()
 
JsonWrap toJson () const
 Convert the encrypted file metadata to an EncryptedFile json object. More...
 
std::string mxcUri () const
 
std::string key () const
 
std::string iv () const
 
std::string sha256Hash () const
 
bool operator== (const EncryptedFileDesc &that) const
 
template<class Archive >
void save (Archive &ar, const unsigned int) const
 
template<class Archive >
void load (Archive &ar, const unsigned int)
 

Static Public Member Functions

static EncryptedFileDesc fromJson (JsonWrap encryptedFile)
 Constructs an EncryptedFileDesc from an EncryptedFile json object. More...
 

Constructor & Destructor Documentation

◆ EncryptedFileDesc() [1/2]

Kazv::EncryptedFileDesc::EncryptedFileDesc ( )

Constructs an empty EncryptedFileDesc.

The mxcUri, key, iv, and sha256Hash are guaranteed to be empty.

◆ EncryptedFileDesc() [2/2]

Kazv::EncryptedFileDesc::EncryptedFileDesc ( std::string  mxcUri,
std::string  key,
std::string  iv,
std::string  sha256Hash 
)

Constructs an EncryptedFileDesc from mxcUri, key, iv and sha256Hash.

Parameters
mxcUriThe mxc uri to the file.
keyThe key encoded as urlsafe unpadded base64.
ivThe iv encoded as unpadded base64.
sha256HashThe SHA256 hash encoded as unpadded base64.

◆ ~EncryptedFileDesc()

Kazv::EncryptedFileDesc::~EncryptedFileDesc ( )
default

Member Function Documentation

◆ fromJson()

EncryptedFileDesc Kazv::EncryptedFileDesc::fromJson ( JsonWrap  encryptedFile)
static

Constructs an EncryptedFileDesc from an EncryptedFile json object.

The EncryptedFile type is defined in https://matrix.org/docs/spec/client_server/latest#id431 .

Returns
An EncryptedFileDesc object representing the EncryptedFile object, if encryptedFile is valid; a default-constructed EncryptedFileDesc otherwise.

◆ iv()

std::string Kazv::EncryptedFileDesc::iv ( ) const
Returns
The iv encoded as unpadded base64.

◆ key()

std::string Kazv::EncryptedFileDesc::key ( ) const
Returns
The key encoded as urlsafe unpadded base64.

◆ load()

template<class Archive >
void Kazv::EncryptedFileDesc::load ( Archive &  ar,
const unsigned int   
)
inline

◆ mxcUri()

std::string Kazv::EncryptedFileDesc::mxcUri ( ) const
Returns
The mxc uri for this file.

◆ operator==()

bool Kazv::EncryptedFileDesc::operator== ( const EncryptedFileDesc that) const
Returns
Whether all of mxcUri, key, iv, and sha256Hash of this and that are equal.

◆ save()

template<class Archive >
void Kazv::EncryptedFileDesc::save ( Archive &  ar,
const unsigned int   
) const
inline

◆ sha256Hash()

std::string Kazv::EncryptedFileDesc::sha256Hash ( ) const
Returns
The SHA256 hash encoded as unpadded base64.

◆ toJson()

JsonWrap Kazv::EncryptedFileDesc::toJson ( ) const

Convert the encrypted file metadata to an EncryptedFile json object.

Returns
An EncryptedFile json object representing this.

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