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< Curve, false > Struct Template Reference

Public Types

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

Public Member Functions

 OneTimePreKey (const X< Curve, lime::Xtype::publicKey > &OPkPublic, const X< Curve, lime::Xtype::privateKey > &OPkPrivate, 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. More...
 
const X< Curve, lime::Xtype::privateKey > & cprivateKey (void) const
 accessors More...
 
const X< Curve, lime::Xtype::publicKey > & cpublicKey (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): First the public value, then the private one. More...
 
std::vector< uint8_t > serializePublic (void) const
 Serialize the public key and Id to publish on the server. More...
 
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 Curve >
using lime::OneTimePreKey< Curve, false >::serializedBuffer = sBuffer<X<Curve, lime::Xtype::publicKey>::ssize() + X<Curve, lime::Xtype::privateKey>::ssize()>

Constructor & Destructor Documentation

template<typename Curve >
lime::OneTimePreKey< Curve, false >::OneTimePreKey ( const X< Curve, lime::Xtype::publicKey > &  OPkPublic,
const X< Curve, lime::Xtype::privateKey > &  OPkPrivate,
uint32_t  Id 
)
inline
template<typename Curve >
lime::OneTimePreKey< Curve, false >::OneTimePreKey ( )
inline
template<typename Curve >
lime::OneTimePreKey< Curve, false >::OneTimePreKey ( const serializedBuffer OPk,
uint32_t  Id 
)
inline

Unserializing constructor: from data read in DB.

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

Unserializing constructor: from data read in received bundle.

Member Function Documentation

template<typename Curve >
const X<Curve, lime::Xtype::privateKey>& lime::OneTimePreKey< Curve, false >::cprivateKey ( void  ) const
inline

accessors

template<typename Curve >
const X<Curve, lime::Xtype::publicKey>& lime::OneTimePreKey< Curve, false >::cpublicKey ( void  ) const
inline
template<typename Curve >
void lime::OneTimePreKey< Curve, false >::dump ( std::ostringstream &  os,
std::string  indent = "        " 
) const
inline

Dump the public key and Id.

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

Serialize the key pair (to store in DB): First the public value, then the private one.

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

Serializing:

  • public is publicKey || Id (4bytes) -> used to publish
  • storage publicKey || privateKey -> used to store in DB, Id is stored separately
template<typename Curve >
static constexpr size_t lime::OneTimePreKey< Curve, false >::serializedSize ( void  )
inlinestatic
template<typename Curve >
std::vector<uint8_t> lime::OneTimePreKey< Curve, false >::serializePublic ( void  ) const
inline

Serialize the public key and Id to publish on the server.

template<typename Curve >
void lime::OneTimePreKey< Curve, false >::set_Id ( uint32_t  Id)
inline

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