join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::TlsKey Class Reference

manage private and public keys. More...

#include <tlskey.hpp>

Public Types

enum  Type { Public , Private }
 key type. More...
 
using Handle = EVP_PKEY*
 

Public Member Functions

 TlsKey ()=default
 default constructor.
 
 TlsKey (const std::string &keyPath, Type keyType=Private)
 create key using a file.
 
 TlsKey (const TlsKey &other)=delete
 copy constructor.
 
TlsKeyoperator= (const TlsKey &other)=delete
 copy assignment operator.
 
 TlsKey (TlsKey &&other)
 move constructor.
 
TlsKeyoperator= (TlsKey &&other)
 move assignment operator.
 
 ~TlsKey ()=default
 destroy the signature stream buffer instance.
 
 operator bool () const
 explicit conversion function for boolean value.
 
Handle handle () const
 get a pointer to the native key handle.
 
int length ()
 return the length in bits of the key.
 
void swap (TlsKey &other)
 swap this key with other.
 
Type type () const
 return the key type.
 
void clear ()
 clear the key.
 

Detailed Description

manage private and public keys.

Member Typedef Documentation

◆ Handle

using join::TlsKey::Handle = EVP_PKEY*

Member Enumeration Documentation

◆ Type

key type.

Enumerator
Public 

public key.

Private 

private key.

Constructor & Destructor Documentation

◆ TlsKey() [1/4]

join::TlsKey::TlsKey ( )
default

default constructor.

◆ TlsKey() [2/4]

TlsKey::TlsKey ( const std::string & keyPath,
Type keyType = Private )

create key using a file.

Parameters
keyPathkey path.
keyTypespecifies whether the key is public or private.

◆ TlsKey() [3/4]

join::TlsKey::TlsKey ( const TlsKey & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ TlsKey() [4/4]

TlsKey::TlsKey ( TlsKey && other)

move constructor.

Parameters
otherother object to move.

◆ ~TlsKey()

join::TlsKey::~TlsKey ( )
default

destroy the signature stream buffer instance.

Member Function Documentation

◆ clear()

void TlsKey::clear ( )

clear the key.

◆ handle()

TlsKey::Handle TlsKey::handle ( ) const

get a pointer to the native key handle.

Returns
a pointer to the native key handle.

◆ length()

int TlsKey::length ( )

return the length in bits of the key.

Returns
the length in bits of the key, -1 if none.

◆ operator bool()

TlsKey::operator bool ( ) const
explicit

explicit conversion function for boolean value.

Returns
converted boolean value.
Exceptions
std::bad_cast.

◆ operator=() [1/2]

TlsKey & join::TlsKey::operator= ( const TlsKey & other)
delete

copy assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ operator=() [2/2]

TlsKey & TlsKey::operator= ( TlsKey && other)

move assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ swap()

void TlsKey::swap ( TlsKey & other)

swap this key with other.

Parameters
otherother key to swap with.

◆ type()

TlsKey::Type TlsKey::type ( ) const

return the key type.

Returns
the key type.

The documentation for this class was generated from the following files: