xrpld
Loading...
Searching...
No Matches
xrpl::SecretKey Class Reference

A secret key. More...

#include <SecretKey.h>

Collaboration diagram for xrpl::SecretKey:

Public Types

using const_iterator = std::uint8_t const*

Public Member Functions

 SecretKey ()=delete
 SecretKey (SecretKey const &)=default
SecretKeyoperator= (SecretKey const &)=default
bool operator== (SecretKey const &)=delete
bool operator!= (SecretKey const &)=delete
 ~SecretKey ()
 SecretKey (std::array< std::uint8_t, kSize > const &data)
 SecretKey (Slice const &slice)
std::uint8_t const * data () const
std::size_t size () const
std::string toString () const
 Convert the secret key to a hexadecimal string.
const_iterator begin () const noexcept
const_iterator cbegin () const noexcept
const_iterator end () const noexcept
const_iterator cend () const noexcept

Static Public Attributes

static constexpr std::size_t kSize = 32

Private Attributes

std::uint8_t buf_ [kSize] {}

Detailed Description

A secret key.

Definition at line 17 of file SecretKey.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 26 of file SecretKey.h.

Constructor & Destructor Documentation

◆ SecretKey() [1/4]

xrpl::SecretKey::SecretKey ( )
delete

◆ SecretKey() [2/4]

xrpl::SecretKey::SecretKey ( SecretKey const & )
default

◆ ~SecretKey()

xrpl::SecretKey::~SecretKey ( )

Definition at line 33 of file SecretKey.cpp.

◆ SecretKey() [3/4]

xrpl::SecretKey::SecretKey ( std::array< std::uint8_t, kSize > const & data)

◆ SecretKey() [4/4]

xrpl::SecretKey::SecretKey ( Slice const & slice)

Definition at line 43 of file SecretKey.cpp.

Member Function Documentation

◆ operator=()

SecretKey & xrpl::SecretKey::operator= ( SecretKey const & )
default

◆ operator==()

bool xrpl::SecretKey::operator== ( SecretKey const & )
delete

◆ operator!=()

bool xrpl::SecretKey::operator!= ( SecretKey const & )
delete

◆ data()

std::uint8_t const * xrpl::SecretKey::data ( ) const
nodiscard

Definition at line 44 of file SecretKey.h.

◆ size()

std::size_t xrpl::SecretKey::size ( ) const
nodiscard

Definition at line 50 of file SecretKey.h.

◆ toString()

std::string xrpl::SecretKey::toString ( ) const
nodiscard

Convert the secret key to a hexadecimal string.

Note
The operator<< function is deliberately omitted to avoid accidental exposure of secret key material.

Definition at line 51 of file SecretKey.cpp.

◆ begin()

const_iterator xrpl::SecretKey::begin ( ) const
nodiscardnoexcept

Definition at line 64 of file SecretKey.h.

◆ cbegin()

const_iterator xrpl::SecretKey::cbegin ( ) const
nodiscardnoexcept

Definition at line 70 of file SecretKey.h.

◆ end()

const_iterator xrpl::SecretKey::end ( ) const
nodiscardnoexcept

Definition at line 76 of file SecretKey.h.

◆ cend()

const_iterator xrpl::SecretKey::cend ( ) const
nodiscardnoexcept

Definition at line 82 of file SecretKey.h.

Member Data Documentation

◆ kSize

std::size_t xrpl::SecretKey::kSize = 32
staticconstexpr

Definition at line 20 of file SecretKey.h.

◆ buf_

std::uint8_t xrpl::SecretKey::buf_[kSize] {}
private

Definition at line 23 of file SecretKey.h.