OpenDDS::Security::SSL::deserialize_impl Struct Reference

List of all members.

Public Member Functions

 deserialize_impl (const DDS::OctetSeq &src)
 ~deserialize_impl ()
int operator() (X509 *&dst)

Private Attributes

const DDS::OctetSeqsrc_
BIO * buffer_

Detailed Description

Definition at line 529 of file Certificate.cpp.


Constructor & Destructor Documentation

OpenDDS::Security::SSL::deserialize_impl::deserialize_impl ( const DDS::OctetSeq src  )  [inline, explicit]

Definition at line 531 of file Certificate.cpp.

00532       : src_(src), buffer_(BIO_new(BIO_s_mem()))
00533     {}

OpenDDS::Security::SSL::deserialize_impl::~deserialize_impl (  )  [inline]

Definition at line 535 of file Certificate.cpp.

References buffer_.

00536     {
00537       BIO_free(buffer_);
00538     }


Member Function Documentation

int OpenDDS::Security::SSL::deserialize_impl::operator() ( X509 *&  dst  )  [inline]

Definition at line 540 of file Certificate.cpp.

References buffer_, len, LM_WARNING, OPENDDS_SSL_LOG_ERR, and src_.

00541     {
00542       if (dst) {
00543         ACE_ERROR((LM_WARNING,
00544                    "(%P|%t) SSL::Certificate::deserialize: WARNING, an X509 certificate "
00545                    "has already been loaded\n"));
00546         return 1;
00547       }
00548 
00549       if (0 == src_.length()) {
00550         ACE_ERROR((LM_WARNING,
00551                    "(%P|%t) SSL::Certificate::deserialize: WARNING, source OctetSeq contains no data"));
00552         return 1;
00553       }
00554 
00555       if (! buffer_) {
00556         OPENDDS_SSL_LOG_ERR("failed to allocate buffer with BIO_new");
00557         return 1;
00558       }
00559 
00560       int len = BIO_write(buffer_, src_.get_buffer(), src_.length());
00561       if (len <= 0) {
00562         OPENDDS_SSL_LOG_ERR("failed to write OctetSeq to BIO");
00563         return 1;
00564       }
00565 
00566       dst = PEM_read_bio_X509_AUX(buffer_, NULL, NULL, NULL);
00567       if (! dst) {
00568         OPENDDS_SSL_LOG_ERR("failed to read X509 from BIO");
00569         return 1;
00570       }
00571 
00572       return 0;
00573     }


Member Data Documentation

Definition at line 577 of file Certificate.cpp.

Referenced by operator()(), and ~deserialize_impl().

Definition at line 576 of file Certificate.cpp.

Referenced by operator()().


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1