SourcePro 11.1 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Adapter class for the cryptographic library's representation of an X.509 certificate. More...
#include <rw/secsock/RWX509Certificate.h>
Public Member Functions | |
RWX509Certificate (const char **certData, int numLines) | |
RWX509Certificate (std::istream &is) | |
void | throwIfNotValid (const RWDateTime &date=RWDateTime(RWDateTime::setCurrentTime)) const |
bool | isValid (const RWDateTime &date=RWDateTime(RWDateTime::setCurrentTime)) const |
RWDateTime | getNotBeforeDate () const |
RWDateTime | getNotAfterDate () const |
RWCString | getIssuerNameString () const |
RWCString | getSubjectNameString () const |
RWCString | getSerialNumber () const |
long | getVersion () const |
int | getPublicKeyLength () const |
RWX509CertificateRep | getRep () const |
Protected Member Functions | |
RWX509CertificateImp & | body () const |
Related Functions | |
(Note that these are not member functions.) | |
typedef X509 * | RWX509CertificateRep |
RWX509Certificate is an adapter for the cryptographic library's representation of an X.509 certificate. A certificate contains a public key and some information concerning the validity of the certificate. The certificate is digitally signed by the issuer to protect its integrity.
RWX509Certificate::RWX509Certificate | ( | const char ** | certData, | |
int | numLines | |||
) | [inline] |
Constructs a certificate from the data pointed to by certData. certData is a pointer to an array of C-style strings that contain the PEM-encoded certificate. Each line of a PEM-encoded certificate is an element in the array of strings.
numLines is the number of lines in the certData array. For example, if you are passing the pointer certData as the first parameter to this constructor, you should pass sizeof(certData)/sizeof(certData[0]) as the second parameter to this constructor.
RWUnableToReadCertificateError | Thrown if the certificate is corrupted. | |
RWSecureSocketUnderlyingAllocationError | Thrown if the cryptographic library is unsuccessful in allocating memory. |
RWX509Certificate::RWX509Certificate | ( | std::istream & | is | ) | [inline] |
Constructs a certificate from the istream
. The input stream should contain only one certificate.
This constructor reads from the istream
until an EOF is read. ifstream
instances automatically end transmissions with an EOF. For example, if you pass an RWPortalIstream that ultimately reads from a socket, the stream only enters the EOF state when the sending socket is closed.
RWUnableToReadCertificateError | Thrown if the certificate is corrupted. | |
RWSecureSocketUnderlyingAllocationError | Thrown if the cryptographic library is unsuccessful in allocating memory. |
RWX509CertificateImp& RWX509Certificate::body | ( | void | ) | const [inline, protected] |
Gets a reference for the body instance, if any.
RWTHRInvalidPointer | Thrown if this handle is not attached to a body. |
Reimplemented from RWHandleBase.
RWCString RWX509Certificate::getIssuerNameString | ( | ) | const [inline] |
Returns an RWCString containing the individual components of the name of the issuer of the certificate, concatenated together.
RWDateTime RWX509Certificate::getNotAfterDate | ( | ) | const [inline] |
Returns the date and time after which the certificate is not valid.
RWDateTime RWX509Certificate::getNotBeforeDate | ( | ) | const [inline] |
Returns the date and time before which the certificate is not valid.
int RWX509Certificate::getPublicKeyLength | ( | ) | const [inline] |
Returns the number of bits in the subject's public key.
RWX509CertificateRep RWX509Certificate::getRep | ( | ) | const [inline] |
Returns a pointer to the cryptographic library's representation of the certificate.
RWCString RWX509Certificate::getSerialNumber | ( | ) | const [inline] |
Returns the serial number of the certificate.
RWCString RWX509Certificate::getSubjectNameString | ( | ) | const [inline] |
Returns an RWCString object containing the individual components of the name, concatenated together.
long RWX509Certificate::getVersion | ( | ) | const [inline] |
Returns the certificate version number. The returned value is always one less than the certificate version. A value of 0
would indicate a certificate version 1.
bool RWX509Certificate::isValid | ( | const RWDateTime & | date = RWDateTime(RWDateTime::setCurrentTime) |
) | const [inline] |
Returns true
if the certificate is valid relative to the date/time false
otherwise. The parameter defaults to the current date/time.
void RWX509Certificate::throwIfNotValid | ( | const RWDateTime & | date = RWDateTime(RWDateTime::setCurrentTime) |
) | const [inline] |
RWCertificateNotValidError | Thrown if the certificate is not valid relative to the date/time. The date parameter defaults to the current date/time. |
typedef X509* RWX509CertificateRep [related] |
This is the internal X.509 certificate representation.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.