All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreSSLCertificate Class Reference

represents an X509 certificate, reference-counted, dynamically-allocated only More...

`#include <QoreSSLCertificate.h>`

Inheritance diagram for QoreSSLCertificate:
[legend]
Collaboration diagram for QoreSSLCertificate:
[legend]

## Public Member Functions

DLLEXPORT | QoreSSLCertificate (X509 *c)
| creates the object from a pointer to an X509 data structure, the QoreSSLCertificate object takes ownership of the X509 pointer
DLLEXPORT | QoreSSLCertificate (const BinaryNode *bin, ExceptionSink *xsink)
| creates the object from a pointer to a BinaryNode object (certificate data in DER format)
DLLEXPORT | QoreSSLCertificate (const QoreString *str, ExceptionSink *xsink)
| create the object from a pointer to a QoreString representing the X.509 certificate in PEM format
DLLLOCAL | QoreSSLCertificate (const char *fn, ExceptionSink *xsink)
| creates the object from a filename
DLLEXPORT | operator bool () const
| returns true if the object is valid, false if not
DLLEXPORT QoreStringNode * | getPEM (ExceptionSink *xsink) const
| returns a string in PEM format representing the certificate; caller owns the QoreStringNode reference returned
Public Member Functions inherited from AbstractPrivateData
DLLLOCAL void | ref ()
| increments the reference count of the object
virtual DLLLOCAL void | deref (class ExceptionSink *xsink)
| decrements the reference count of the object
virtual DLLLOCAL void | deref ()
| decrements the reference count of the object without the possibility of throwing a Qore-language exception
Public Member Functions inherited from QoreReferenceCounter
DLLEXPORT | QoreReferenceCounter ()
| creates the reference counter object
DLLEXPORT | ~QoreReferenceCounter ()
| destroys the reference counter object
DLLLOCAL int | reference_count () const
| gets the reference count
DLLLOCAL bool | is_unique () const
| returns true if the reference count is 1
DLLEXPORT void | ROreference () const
| atomically increments the reference count
DLLEXPORT bool | ROdereference () const
| atomically decrements the reference count

## Protected Member Functions

virtual DLLLOCAL | ~QoreSSLCertificate ()
| the destructor is protected to ensure that it's only dynamically allocated (use deref() to delete)
Protected Member Functions inherited from AbstractPrivateData
virtual DLLLOCAL | ~AbstractPrivateData ()
| as these objects are reference counted, the destructor should be called only when the reference count = 0 and not manually

## Additional Inherited Members

Protected Attributes inherited from QoreReferenceCounter
QoreThreadLock | mRO
| pthread lock to ensure atomicity of updates for architectures where we don't have an atomic increment and decrement implementation

## Detailed Description

represents an X509 certificate, reference-counted, dynamically-allocated only

## Constructor & Destructor Documentation

DLLEXPORT QoreSSLCertificate::QoreSSLCertificate | ( | X509 * | c | ) |

creates the object from a pointer to an X509 data structure, the QoreSSLCertificate object takes ownership of the X509 pointer

Parameters

  c | a pointer to an X509 data structure, the QoreSSLCertificate object takes ownership of the X509 pointer

DLLEXPORT QoreSSLCertificate::QoreSSLCertificate | ( | const BinaryNode * | bin,
|  | ExceptionSink * | xsink
| ) |  |

creates the object from a pointer to a BinaryNode object (certificate data in DER format)

Parameters

  bin | a pointer to a BinaryNode object with the raw binary certificate information
  xsink | Qore-language exceptions are raised here in case of errors

DLLEXPORT QoreSSLCertificate::QoreSSLCertificate | ( | const QoreString * | str,
|  | ExceptionSink * | xsink
| ) |  |

create the object from a pointer to a QoreString representing the X.509 certificate in PEM format

Parameters

  str | a pointer to a QoreString with the certificatge in PEM format
  xsink | Qore-language exceptions are raised here in case of errors

DLLLOCAL QoreSSLCertificate::QoreSSLCertificate | ( | const char * | fn,
|  | ExceptionSink * | xsink
| ) |  |

creates the object from a filename

Parameters

  fn | the filename of the certificate file in PEM format
  xsink | Qore-language exceptions are raised here in case of errors

## Member Function Documentation

DLLEXPORT QoreStringNode* QoreSSLCertificate::getPEM | ( | ExceptionSink * | xsink | ) | const

returns a string in PEM format representing the certificate; caller owns the QoreStringNode reference returned

Returns
  a string in PEM format representing the certificate; caller owns the QoreStringNode reference returned

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

- include/qore/QoreSSLCertificate.h (5431)