OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | List of all members
OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM Class Reference

#include <DiffieHellman.h>

Inheritance diagram for OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM:
Collaboration graph
[legend]

Public Member Functions

 ECDH_PRIME_256_V1_CEUM ()
 
 ~ECDH_PRIME_256_V1_CEUM ()
 
int init ()
 
int pub_key (DDS::OctetSeq &dst)
 
int compute_shared_secret (const DDS::OctetSeq &pub_key)
 
const char * kagree_algo () const
 
- Public Member Functions inherited from OpenDDS::Security::SSL::DHAlgorithm
 DHAlgorithm ()
 
virtual ~DHAlgorithm ()
 
virtual int gen_shared_secret (const DDS::OctetSeq &pub_key)
 
virtual const DDS::OctetSeqget_shared_secret () const
 
virtual bool cmp_shared_secret (const DHAlgorithm &other) const
 

Additional Inherited Members

- Public Types inherited from OpenDDS::Security::SSL::DHAlgorithm
typedef DCPS::unique_ptr< DHAlgorithmunique_ptr
 
- Protected Member Functions inherited from OpenDDS::Security::SSL::DHAlgorithm
int hash_shared_secret ()
 
- Protected Attributes inherited from OpenDDS::Security::SSL::DHAlgorithm
EVP_PKEYk_
 
DDS::OctetSeq shared_secret_
 

Detailed Description

Definition at line 80 of file DiffieHellman.h.

Constructor & Destructor Documentation

◆ ECDH_PRIME_256_V1_CEUM()

OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::ECDH_PRIME_256_V1_CEUM ( )

Definition at line 360 of file DiffieHellman.cpp.

References init().

◆ ~ECDH_PRIME_256_V1_CEUM()

OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::~ECDH_PRIME_256_V1_CEUM ( )

Definition at line 362 of file DiffieHellman.cpp.

362 {}

Member Function Documentation

◆ compute_shared_secret()

int OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::compute_shared_secret ( const DDS::OctetSeq pub_key)
virtual
Returns
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 703 of file DiffieHellman.cpp.

704 {
705  ecdh_shared_secret_from_octets secret(k_);
706  return secret(pub_key, shared_secret_);
707 }

◆ init()

int OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::init ( void  )
virtual
Returns
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 429 of file DiffieHellman.cpp.

References OpenDDS::Security::SSL::ecdh_constructor::get_key().

430 {
431  if (k_) return 0;
432 
433  ecdh_constructor ecdh;
434  k_ = ecdh.get_key();
435 
436  return k_ ? 0 : 1;
437 }

◆ kagree_algo()

const char* OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::kagree_algo ( ) const
inlinevirtual

◆ pub_key()

int OpenDDS::Security::SSL::ECDH_PRIME_256_V1_CEUM::pub_key ( DDS::OctetSeq dst)
virtual
Returns
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 537 of file DiffieHellman.cpp.

538 {
539  ecdh_pubkey_as_octets pubkey(k_);
540  return pubkey(dst);
541 }

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