lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lime::OneTimePreKey< Algo, true > Struct Template Reference

Public Types

using serializedBuffer = sBuffer< X< Algo, lime::Xtype::publicKey >::ssize()+X< Algo, lime::Xtype::privateKey >::ssize()+K< Algo, lime::Ktype::publicKey >::ssize()+K< Algo, lime::Ktype::privateKey >::ssize()>
 

Public Member Functions

 OneTimePreKey (const X< typename Algo::EC, lime::Xtype::publicKey > &ECPublic, const X< typename Algo::EC, lime::Xtype::privateKey > &ECPrivate, const K< typename Algo::KEM, lime::Ktype::publicKey > &KEMPublic, const K< typename Algo::KEM, lime::Ktype::privateKey > &KEMPrivate, uint32_t Id)
 
 OneTimePreKey ()
 
 OneTimePreKey (const serializedBuffer &OPk, uint32_t Id)
 Unserializing constructor: from data read in DB. More...
 
 OneTimePreKey (const std::vector< uint8_t >::const_iterator s)
 Unserializing constructor: from data read in received bundle EC public key || KEM public key || Id. More...
 
const X< typename Algo::EC, lime::Xtype::privateKey > & cECprivateKey (void) const
 accessors More...
 
const X< typename Algo::EC, lime::Xtype::publicKey > & cECpublicKey (void) const
 
const K< typename Algo::KEM, lime::Ktype::privateKey > & cKEMprivateKey (void) const
 
const K< typename Algo::KEM, lime::Ktype::publicKey > & cKEMpublicKey (void) const
 
uint32_t get_Id (void) const
 
void set_Id (uint32_t Id)
 
serializedBuffer serialize (void) const
 Serialize the key pair (to store in DB): EC public || EC private || KEM public || KEM private. More...
 
std::vector< uint8_t > serializePublic (void) const
 
void dump (std::ostringstream &os, std::string indent=" ") const
 Dump the public key and Id. More...
 

Static Public Member Functions

static constexpr size_t serializedPublicSize (void)
 
static constexpr size_t serializedSize (void)
 

Member Typedef Documentation

template<typename Algo >
using lime::OneTimePreKey< Algo, true >::serializedBuffer = sBuffer< X<Algo, lime::Xtype::publicKey>::ssize() + X<Algo, lime::Xtype::privateKey>::ssize() + K<Algo, lime::Ktype::publicKey>::ssize() + K<Algo, lime::Ktype::privateKey>::ssize()>

Constructor & Destructor Documentation

template<typename Algo >
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( const X< typename Algo::EC, lime::Xtype::publicKey > &  ECPublic,
const X< typename Algo::EC, lime::Xtype::privateKey > &  ECPrivate,
const K< typename Algo::KEM, lime::Ktype::publicKey > &  KEMPublic,
const K< typename Algo::KEM, lime::Ktype::privateKey > &  KEMPrivate,
uint32_t  Id 
)
inline
template<typename Algo >
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( )
inline
template<typename Algo >
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( const serializedBuffer OPk,
uint32_t  Id 
)
inline

Unserializing constructor: from data read in DB.

template<typename Algo >
lime::OneTimePreKey< Algo, true >::OneTimePreKey ( const std::vector< uint8_t >::const_iterator  s)
inline

Unserializing constructor: from data read in received bundle EC public key || KEM public key || Id.

Member Function Documentation

template<typename Algo >
const X<typename Algo::EC, lime::Xtype::privateKey>& lime::OneTimePreKey< Algo, true >::cECprivateKey ( void  ) const
inline

accessors

template<typename Algo >
const X<typename Algo::EC, lime::Xtype::publicKey>& lime::OneTimePreKey< Algo, true >::cECpublicKey ( void  ) const
inline
template<typename Algo >
const K<typename Algo::KEM, lime::Ktype::privateKey>& lime::OneTimePreKey< Algo, true >::cKEMprivateKey ( void  ) const
inline
template<typename Algo >
const K<typename Algo::KEM, lime::Ktype::publicKey>& lime::OneTimePreKey< Algo, true >::cKEMpublicKey ( void  ) const
inline
template<typename Algo >
void lime::OneTimePreKey< Algo, true >::dump ( std::ostringstream &  os,
std::string  indent = "        " 
) const
inline

Dump the public key and Id.

template<typename Algo >
uint32_t lime::OneTimePreKey< Algo, true >::get_Id ( void  ) const
inline
template<typename Algo >
serializedBuffer lime::OneTimePreKey< Algo, true >::serialize ( void  ) const
inline

Serialize the key pair (to store in DB): EC public || EC private || KEM public || KEM private.

template<typename Algo >
static constexpr size_t lime::OneTimePreKey< Algo, true >::serializedPublicSize ( void  )
inlinestatic

Serializing:

  • public is EC public Key || KEM public key || Id (4bytes) -> used to publish
  • storage EC public Key || EC private Key || KEM public key || KEM private key -> used to store in DB, Id is stored separately
template<typename Algo >
static constexpr size_t lime::OneTimePreKey< Algo, true >::serializedSize ( void  )
inlinestatic
template<typename Algo >
std::vector<uint8_t> lime::OneTimePreKey< Algo, true >::serializePublic ( void  ) const
inline

Serialize the public key and Id to publish on the server : EC public key || KEM public key || Id

Parameters
[in]signedMessagewhen true return the only the OPk part to be signed
template<typename Algo >
void lime::OneTimePreKey< Algo, true >::set_Id ( uint32_t  Id)
inline

The documentation for this struct was generated from the following file: