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::SignedPreKey< 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

 SignedPreKey (const X< Curve, lime::Xtype::publicKey > &SPkPublic, const X< Curve, lime::Xtype::privateKey > &SPkPrivate)
 
 SignedPreKey ()
 
 SignedPreKey (const serializedBuffer &SPk, uint32_t Id)
 Unserializing constructor: from data read in DB. More...
 
 SignedPreKey (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
 
const DSA< Curve, lime::DSAtype::signature > & csignature (void) const
 
DSA< Curve, lime::DSAtype::signature > & signature (void)
 
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 (bool signedMessage=false) const
 
void dump (std::ostringstream &os, std::string indent=" ") const
 Dump the public key, signature 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::SignedPreKey< Curve, false >::serializedBuffer = sBuffer<X<Curve, lime::Xtype::publicKey>::ssize() + X<Curve, lime::Xtype::privateKey>::ssize()>

Constructor & Destructor Documentation

template<typename Curve >
lime::SignedPreKey< Curve, false >::SignedPreKey ( const X< Curve, lime::Xtype::publicKey > &  SPkPublic,
const X< Curve, lime::Xtype::privateKey > &  SPkPrivate 
)
inline
template<typename Curve >
lime::SignedPreKey< Curve, false >::SignedPreKey ( )
inline
template<typename Curve >
lime::SignedPreKey< Curve, false >::SignedPreKey ( const serializedBuffer SPk,
uint32_t  Id 
)
inline

Unserializing constructor: from data read in DB.

template<typename Curve >
lime::SignedPreKey< Curve, false >::SignedPreKey ( 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::SignedPreKey< Curve, false >::cprivateKey ( void  ) const
inline

accessors

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

Dump the public key, signature and Id.

template<typename Curve >
uint32_t lime::SignedPreKey< Curve, false >::get_Id ( void  ) const
inline
template<typename Curve >
serializedBuffer lime::SignedPreKey< 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::SignedPreKey< Curve, false >::serializedPublicSize ( void  )
inlinestatic

Serializing:

  • public is publicKey || signature || 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::SignedPreKey< Curve, false >::serializedSize ( void  )
inlinestatic
template<typename Curve >
std::vector<uint8_t> lime::SignedPreKey< Curve, false >::serializePublic ( bool  signedMessage = false) const
inline

Serialize the public key, signature and Id to publish on the server

Parameters
[in]signedMessagewhen true return the message (to be)signed - in this case the public key
Returns
the serialized public value: either the public part to be signed, or the whole bundle: public key || signature || Id
template<typename Curve >
void lime::SignedPreKey< Curve, false >::set_Id ( uint32_t  Id)
inline
template<typename Curve >
DSA<Curve, lime::DSAtype::signature>& lime::SignedPreKey< Curve, false >::signature ( void  )
inline

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