lime
Lime is a C++ library implementing Open Whisper System Signal protocol
Loading...
Searching...
No Matches
lime::SignedPreKey< Curve, false > Struct Template Reference

#include <lime_x3dh.hpp>

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.
 SignedPreKey (const std::vector< uint8_t >::const_iterator s)
 Unserializing constructor: from data read in received bundle.
const X< Curve, lime::Xtype::privateKey > & cprivateKey (void) const
 accessors
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.
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.

Static Public Member Functions

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

Member Typedef Documentation

◆ serializedBuffer

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

◆ SignedPreKey() [1/4]

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

◆ SignedPreKey() [2/4]

template<typename Curve>
lime::SignedPreKey< Curve, false >::SignedPreKey ( )
inline

◆ SignedPreKey() [3/4]

template<typename Curve>
lime::SignedPreKey< Curve, false >::SignedPreKey ( const serializedBuffer & SPk,
uint32_t Id )
inline

Unserializing constructor: from data read in DB.

◆ SignedPreKey() [4/4]

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

◆ cprivateKey()

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

accessors

◆ cpublicKey()

template<typename Curve>
const X< Curve, lime::Xtype::publicKey > & lime::SignedPreKey< Curve, false >::cpublicKey ( void ) const
inline

◆ csignature()

template<typename Curve>
const DSA< Curve, lime::DSAtype::signature > & lime::SignedPreKey< Curve, false >::csignature ( void ) const
inline

◆ dump()

template<typename Curve>
void lime::SignedPreKey< Curve, false >::dump ( std::ostringstream & os,
std::string indent = "        " ) const
inline

Dump the public key, signature and Id.

◆ get_Id()

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

◆ serialize()

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.

◆ serializedPublicSize()

template<typename Curve>
constexpr size_t lime::SignedPreKey< Curve, false >::serializedPublicSize ( void )
inlinestaticconstexpr

Serializing:

  • public is publicKey || signature || Id (4bytes) -> used to publish
  • storage publicKey || privateKey -> used to store in DB, Id is stored separately

◆ serializedSize()

template<typename Curve>
constexpr size_t lime::SignedPreKey< Curve, false >::serializedSize ( void )
inlinestaticconstexpr

◆ serializePublic()

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

◆ set_Id()

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

◆ signature()

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: