<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qsslcertificate.cpp --> <title>Qt 4.8: QSslCertificate Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtnetwork.html">QtNetwork</a></li> <li>QSslCertificate</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QSslCertificate Class Reference</h1> <!-- $$$QSslCertificate-brief --> <p>The QSslCertificate class provides a convenient API for an X509 certificate. <a href="#details">More...</a></p> <!-- @@@QSslCertificate --> <pre class="cpp"> <span class="preprocessor">#include <QSslCertificate></span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <p>This class was introduced in Qt 4.3.</p> <ul> <li><a href="qsslcertificate-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#SubjectInfo-enum">SubjectInfo</a></b> { Organization, CommonName, LocalityName, OrganizationalUnitName, CountryName, StateOrProvinceName }</td></tr> </table> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#QSslCertificate">QSslCertificate</a></b> ( QIODevice * <i>device</i>, QSsl::EncodingFormat <i>format</i> = QSsl::Pem )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#QSslCertificate-2">QSslCertificate</a></b> ( const QByteArray & <i>data</i> = QByteArray(), QSsl::EncodingFormat <i>format</i> = QSsl::Pem )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#QSslCertificate-3">QSslCertificate</a></b> ( const QSslCertificate & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#dtor.QSslCertificate">~QSslCertificate</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QMultiMap<QSsl::AlternateNameEntryType, QString> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#alternateSubjectNames">alternateSubjectNames</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#clear">clear</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#digest">digest</a></b> ( QCryptographicHash::Algorithm <i>algorithm</i> = QCryptographicHash::Md5 ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#effectiveDate">effectiveDate</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#expiryDate">expiryDate</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Qt::HANDLE </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#handle">handle</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#isNull">isNull</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#isValid">isValid</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#issuerInfo">issuerInfo</a></b> ( SubjectInfo <i>subject</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#issuerInfo-2">issuerInfo</a></b> ( const QByteArray & <i>tag</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QSslKey </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#publicKey">publicKey</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#serialNumber">serialNumber</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#subjectInfo">subjectInfo</a></b> ( SubjectInfo <i>subject</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#subjectInfo-2">subjectInfo</a></b> ( const QByteArray & <i>tag</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#toDer">toDer</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#toPem">toPem</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#version">version</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#operator-not-eq">operator!=</a></b> ( const QSslCertificate & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QSslCertificate & </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#operator-eq">operator=</a></b> ( const QSslCertificate & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#operator-eq-eq">operator==</a></b> ( const QSslCertificate & <i>other</i> ) const</td></tr> </table> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QList<QSslCertificate> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#fromData">fromData</a></b> ( const QByteArray & <i>data</i>, QSsl::EncodingFormat <i>format</i> = QSsl::Pem )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QSslCertificate> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#fromDevice">fromDevice</a></b> ( QIODevice * <i>device</i>, QSsl::EncodingFormat <i>format</i> = QSsl::Pem )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QSslCertificate> </td><td class="memItemRight bottomAlign"><b><a href="qsslcertificate.html#fromPath">fromPath</a></b> ( const QString & <i>path</i>, QSsl::EncodingFormat <i>format</i> = QSsl::Pem, QRegExp::PatternSyntax <i>syntax</i> = QRegExp::FixedString )</td></tr> </table> <a name="details"></a> <!-- $$$QSslCertificate-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QSslCertificate class provides a convenient API for an X509 certificate.</p> <p>QSslCertificate stores an X509 certificate, and is commonly used to verify the identity and store information about the local host, a remotely connected peer, or a trusted third party Certificate Authority.</p> <p>There are many ways to construct a QSslCertificate. The most common way is to call <a href="qsslsocket.html#peerCertificate">QSslSocket::peerCertificate</a>(), which returns a QSslCertificate object, or <a href="qsslsocket.html#peerCertificateChain">QSslSocket::peerCertificateChain</a>(), which returns a list of them. You can also load certificates from a DER (binary) or PEM (Base64) encoded bundle, typically stored as one or more local files, or in a Qt Resource.</p> <p>You can call <a href="qsslcertificate.html#isNull">isNull</a>() to check if your certificate is null. By default, QSslCertificate constructs a null certificate. To check if the certificate is valid, call <a href="qsslcertificate.html#isValid">isValid</a>(). A null certificate is invalid, but an invalid certificate is not necessarily null. If you want to reset all contents in a certificate, call <a href="qsslcertificate.html#clear">clear</a>().</p> <p>After loading a certificate, you can find information about the certificate, its subject, and its issuer, by calling one of the many accessor functions, including <a href="qsslcertificate.html#version">version</a>(), <a href="qsslcertificate.html#serialNumber">serialNumber</a>(), <a href="qsslcertificate.html#issuerInfo">issuerInfo</a>() and <a href="qsslcertificate.html#subjectInfo">subjectInfo</a>(). You can call <a href="qsslcertificate.html#effectiveDate">effectiveDate</a>() and <a href="qsslcertificate.html#expiryDate">expiryDate</a>() to check when the certificate starts being effective and when it expires. The <a href="qsslcertificate.html#publicKey">publicKey</a>() function returns the certificate subject's public key as a <a href="qsslkey.html">QSslKey</a>. You can call <a href="qsslcertificate.html#issuerInfo">issuerInfo</a>() or <a href="qsslcertificate.html#subjectInfo">subjectInfo</a>() to get detailed information about the certificate issuer and its subject.</p> <p>Internally, QSslCertificate is stored as an X509 structure. You can access this handle by calling <a href="qsslcertificate.html#handle">handle</a>(), but the results are likely to not be portable.</p> </div> <p><b>See also </b><a href="qsslsocket.html">QSslSocket</a>, <a href="qsslkey.html">QSslKey</a>, <a href="qsslcipher.html">QSslCipher</a>, and <a href="qsslerror.html">QSslError</a>.</p> <!-- @@@QSslCertificate --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$SubjectInfo$$$Organization$$$CommonName$$$LocalityName$$$OrganizationalUnitName$$$CountryName$$$StateOrProvinceName --> <h3 class="fn"><a name="SubjectInfo-enum"></a>enum QSslCertificate::<span class="name">SubjectInfo</span></h3> <p>Describes keys that you can pass to <a href="qsslcertificate.html#issuerInfo">QSslCertificate::issuerInfo</a>() or <a href="qsslcertificate.html#subjectInfo">QSslCertificate::subjectInfo</a>() to get information about the certificate issuer or subject.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QSslCertificate::Organization</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">"O" The name of the organization.</td></tr> <tr><td class="topAlign"><tt>QSslCertificate::CommonName</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">"CN" The common name; most often this is used to store the host name.</td></tr> <tr><td class="topAlign"><tt>QSslCertificate::LocalityName</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">"L" The locality.</td></tr> <tr><td class="topAlign"><tt>QSslCertificate::OrganizationalUnitName</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">"OU" The organizational unit name.</td></tr> <tr><td class="topAlign"><tt>QSslCertificate::CountryName</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">"C" The country.</td></tr> <tr><td class="topAlign"><tt>QSslCertificate::StateOrProvinceName</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">"ST" The state or province.</td></tr> </table> <!-- @@@SubjectInfo --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QSslCertificate[overload1]$$$QSslCertificateQIODevice*QSsl::EncodingFormat --> <h3 class="fn"><a name="QSslCertificate"></a>QSslCertificate::<span class="name">QSslCertificate</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i>, <span class="type"><a href="qssl.html#EncodingFormat-enum">QSsl::EncodingFormat</a></span> <i>format</i> = QSsl::Pem )</h3> <p>Constructs a <a href="qsslcertificate.html">QSslCertificate</a> by reading <i>format</i> encoded data from <i>device</i> and using the first certificate found. You can later call <a href="qsslcertificate.html#isNull">isNull</a>() to see if <i>device</i> contained a certificate, and if this certificate was loaded successfully.</p> <!-- @@@QSslCertificate --> <!-- $$$QSslCertificate$$$QSslCertificateconstQByteArray&QSsl::EncodingFormat --> <h3 class="fn"><a name="QSslCertificate-2"></a>QSslCertificate::<span class="name">QSslCertificate</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>data</i> = QByteArray(), <span class="type"><a href="qssl.html#EncodingFormat-enum">QSsl::EncodingFormat</a></span> <i>format</i> = QSsl::Pem )</h3> <p>Constructs a <a href="qsslcertificate.html">QSslCertificate</a> by parsing the <i>format</i> encoded <i>data</i> and using the first available certificate found. You can later call <a href="qsslcertificate.html#isNull">isNull</a>() to see if <i>data</i> contained a certificate, and if this certificate was loaded successfully.</p> <!-- @@@QSslCertificate --> <!-- $$$QSslCertificate$$$QSslCertificateconstQSslCertificate& --> <h3 class="fn"><a name="QSslCertificate-3"></a>QSslCertificate::<span class="name">QSslCertificate</span> ( const <span class="type">QSslCertificate</span> & <i>other</i> )</h3> <p>Constructs an identical copy of <i>other</i>.</p> <!-- @@@QSslCertificate --> <!-- $$$~QSslCertificate[overload1]$$$~QSslCertificate --> <h3 class="fn"><a name="dtor.QSslCertificate"></a>QSslCertificate::<span class="name">~QSslCertificate</span> ()</h3> <p>Destroys the <a href="qsslcertificate.html">QSslCertificate</a>.</p> <!-- @@@~QSslCertificate --> <!-- $$$alternateSubjectNames[overload1]$$$alternateSubjectNames --> <h3 class="fn"><a name="alternateSubjectNames"></a><span class="type"><a href="qmultimap.html">QMultiMap</a></span><<span class="type"><a href="qssl.html#AlternateNameEntryType-enum">QSsl::AlternateNameEntryType</a></span>, <span class="type"><a href="qstring.html">QString</a></span>> QSslCertificate::<span class="name">alternateSubjectNames</span> () const</h3> <p>Returns the list of alternative subject names for this certificate. The alternate subject names typically contain host names, optionally with wildcards, that are valid for this certificate.</p> <p>These names are tested against the connected peer's host name, if either the subject information for <a href="qsslcertificate.html#SubjectInfo-enum">CommonName</a> doesn't define a valid host name, or the subject info name doesn't match the peer's host name.</p> <p><b>See also </b><a href="qsslcertificate.html#subjectInfo">subjectInfo</a>().</p> <!-- @@@alternateSubjectNames --> <!-- $$$clear[overload1]$$$clear --> <h3 class="fn"><a name="clear"></a><span class="type">void</span> QSslCertificate::<span class="name">clear</span> ()</h3> <p>Clears the contents of this certificate, making it a null certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#isNull">isNull</a>().</p> <!-- @@@clear --> <!-- $$$digest[overload1]$$$digestQCryptographicHash::Algorithm --> <h3 class="fn"><a name="digest"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QSslCertificate::<span class="name">digest</span> ( <span class="type"><a href="qcryptographichash.html#Algorithm-enum">QCryptographicHash::Algorithm</a></span> <i>algorithm</i> = QCryptographicHash::Md5 ) const</h3> <p>Returns a cryptographic digest of this certificate. By default, an MD5 digest will be generated, but you can also specify a custom <i>algorithm</i>.</p> <!-- @@@digest --> <!-- $$$effectiveDate[overload1]$$$effectiveDate --> <h3 class="fn"><a name="effectiveDate"></a><span class="type"><a href="qdatetime.html">QDateTime</a></span> QSslCertificate::<span class="name">effectiveDate</span> () const</h3> <p>Returns the date-time that the certificate becomes valid, or an empty <a href="qdatetime.html">QDateTime</a> if this is a null certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#expiryDate">expiryDate</a>().</p> <!-- @@@effectiveDate --> <!-- $$$expiryDate[overload1]$$$expiryDate --> <h3 class="fn"><a name="expiryDate"></a><span class="type"><a href="qdatetime.html">QDateTime</a></span> QSslCertificate::<span class="name">expiryDate</span> () const</h3> <p>Returns the date-time that the certificate expires, or an empty <a href="qdatetime.html">QDateTime</a> if this is a null certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#effectiveDate">effectiveDate</a>().</p> <!-- @@@expiryDate --> <!-- $$$fromData[overload1]$$$fromDataconstQByteArray&QSsl::EncodingFormat --> <h3 class="fn"><a name="fromData"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type">QSslCertificate</span>> QSslCertificate::<span class="name">fromData</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>data</i>, <span class="type"><a href="qssl.html#EncodingFormat-enum">QSsl::EncodingFormat</a></span> <i>format</i> = QSsl::Pem )<tt> [static]</tt></h3> <p>Searches for and parses all certificates in <i>data</i> that are encoded in the specified <i>format</i> and returns them in a list of certificates.</p> <p><b>See also </b><a href="qsslcertificate.html#fromDevice">fromDevice</a>().</p> <!-- @@@fromData --> <!-- $$$fromDevice[overload1]$$$fromDeviceQIODevice*QSsl::EncodingFormat --> <h3 class="fn"><a name="fromDevice"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type">QSslCertificate</span>> QSslCertificate::<span class="name">fromDevice</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i>, <span class="type"><a href="qssl.html#EncodingFormat-enum">QSsl::EncodingFormat</a></span> <i>format</i> = QSsl::Pem )<tt> [static]</tt></h3> <p>Searches for and parses all certificates in <i>device</i> that are encoded in the specified <i>format</i> and returns them in a list of certificates.</p> <p><b>See also </b><a href="qsslcertificate.html#fromData">fromData</a>().</p> <!-- @@@fromDevice --> <!-- $$$fromPath[overload1]$$$fromPathconstQString&QSsl::EncodingFormatQRegExp::PatternSyntax --> <h3 class="fn"><a name="fromPath"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type">QSslCertificate</span>> QSslCertificate::<span class="name">fromPath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>path</i>, <span class="type"><a href="qssl.html#EncodingFormat-enum">QSsl::EncodingFormat</a></span> <i>format</i> = QSsl::Pem, <span class="type"><a href="qregexp.html#PatternSyntax-enum">QRegExp::PatternSyntax</a></span> <i>syntax</i> = QRegExp::FixedString )<tt> [static]</tt></h3> <p>Searches all files in the <i>path</i> for certificates encoded in the specified <i>format</i> and returns them in a list. <i>must</i> be a file or a pattern matching one or more files, as specified by <i>syntax</i>.</p> <p>Example:</p> <pre class="cpp"> <a href="qtglobal.html#foreach">foreach</a> (<span class="keyword">const</span> <span class="type"><a href="qsslcertificate.html">QSslCertificate</a></span> <span class="operator">&</span>cert<span class="operator">,</span> <span class="type"><a href="qsslcertificate.html">QSslCertificate</a></span><span class="operator">::</span>fromPath(<span class="string">"C:/ssl/certificate.*.pem"</span><span class="operator">,</span> <span class="type"><a href="qssl.html">QSsl</a></span><span class="operator">::</span>Pem<span class="operator">,</span> <span class="type"><a href="qregexp.html">QRegExp</a></span><span class="operator">::</span>Wildcard)) { <a href="qtglobal.html#qDebug">qDebug</a>() <span class="operator"><</span><span class="operator"><</span> cert<span class="operator">.</span>issuerInfo(<span class="type"><a href="qsslcertificate.html">QSslCertificate</a></span><span class="operator">::</span>Organization); }</pre> <p><b>See also </b><a href="qsslcertificate.html#fromData">fromData</a>().</p> <!-- @@@fromPath --> <!-- $$$handle[overload1]$$$handle --> <h3 class="fn"><a name="handle"></a><span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> QSslCertificate::<span class="name">handle</span> () const</h3> <p>Returns a pointer to the native certificate handle, if there is one, or a null pointer otherwise.</p> <p>You can use this handle, together with the native API, to access extended information about the certificate.</p> <p><b>Warning:</b> Use of this function has a high probability of being non-portable, and its return value may vary from platform to platform or change from minor release to minor release.</p> <!-- @@@handle --> <!-- $$$isNull[overload1]$$$isNull --> <h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QSslCertificate::<span class="name">isNull</span> () const</h3> <p>Returns true if this is a null certificate (i.e., a certificate with no contents); otherwise returns false.</p> <p>By default, <a href="qsslcertificate.html">QSslCertificate</a> constructs a null certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#isValid">isValid</a>() and <a href="qsslcertificate.html#clear">clear</a>().</p> <!-- @@@isNull --> <!-- $$$isValid[overload1]$$$isValid --> <h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QSslCertificate::<span class="name">isValid</span> () const</h3> <p>Returns true if this certificate is valid; otherwise returns false.</p> <p>Note: Currently, this function checks that the current data-time is within the date-time range during which the certificate is considered valid, and checks that the certificate is not in a blacklist of fraudulent certificates.</p> <p><b>See also </b><a href="qsslcertificate.html#isNull">isNull</a>().</p> <!-- @@@isValid --> <!-- $$$issuerInfo[overload1]$$$issuerInfoSubjectInfo --> <h3 class="fn"><a name="issuerInfo"></a><span class="type"><a href="qstring.html">QString</a></span> QSslCertificate::<span class="name">issuerInfo</span> ( <span class="type"><a href="qsslcertificate.html#SubjectInfo-enum">SubjectInfo</a></span> <i>subject</i> ) const</h3> <p>Returns the issuer information for the <i>subject</i> from the certificate, or an empty string if there is no information for <i>subject</i> in the certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#subjectInfo">subjectInfo</a>().</p> <!-- @@@issuerInfo --> <!-- $$$issuerInfo$$$issuerInfoconstQByteArray& --> <h3 class="fn"><a name="issuerInfo-2"></a><span class="type"><a href="qstring.html">QString</a></span> QSslCertificate::<span class="name">issuerInfo</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>tag</i> ) const</h3> <p>Returns the issuer information for <i>tag</i> from the certificate, or an empty string if there is no information for <i>tag</i> in the certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#subjectInfo">subjectInfo</a>().</p> <!-- @@@issuerInfo --> <!-- $$$publicKey[overload1]$$$publicKey --> <h3 class="fn"><a name="publicKey"></a><span class="type"><a href="qsslkey.html">QSslKey</a></span> QSslCertificate::<span class="name">publicKey</span> () const</h3> <p>Returns the certificate subject's public key.</p> <!-- @@@publicKey --> <!-- $$$serialNumber[overload1]$$$serialNumber --> <h3 class="fn"><a name="serialNumber"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QSslCertificate::<span class="name">serialNumber</span> () const</h3> <p>Returns the certificate's serial number string in decimal format. In case the serial number cannot be converted to decimal format (i.e. if it is bigger than 4294967295, which means it does not fit into 4 bytes), its hexadecimal version is returned.</p> <!-- @@@serialNumber --> <!-- $$$subjectInfo[overload1]$$$subjectInfoSubjectInfo --> <h3 class="fn"><a name="subjectInfo"></a><span class="type"><a href="qstring.html">QString</a></span> QSslCertificate::<span class="name">subjectInfo</span> ( <span class="type"><a href="qsslcertificate.html#SubjectInfo-enum">SubjectInfo</a></span> <i>subject</i> ) const</h3> <p>Returns the information for the <i>subject</i>, or an empty string if there is no information for <i>subject</i> in the certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#issuerInfo">issuerInfo</a>().</p> <!-- @@@subjectInfo --> <!-- $$$subjectInfo$$$subjectInfoconstQByteArray& --> <h3 class="fn"><a name="subjectInfo-2"></a><span class="type"><a href="qstring.html">QString</a></span> QSslCertificate::<span class="name">subjectInfo</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>tag</i> ) const</h3> <p>Returns the subject information for <i>tag</i>, or an empty string if there is no information for <i>tag</i> in the certificate.</p> <p><b>See also </b><a href="qsslcertificate.html#issuerInfo">issuerInfo</a>().</p> <!-- @@@subjectInfo --> <!-- $$$toDer[overload1]$$$toDer --> <h3 class="fn"><a name="toDer"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QSslCertificate::<span class="name">toDer</span> () const</h3> <p>Returns this certificate converted to a DER (binary) encoded representation.</p> <!-- @@@toDer --> <!-- $$$toPem[overload1]$$$toPem --> <h3 class="fn"><a name="toPem"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QSslCertificate::<span class="name">toPem</span> () const</h3> <p>Returns this certificate converted to a PEM (Base64) encoded representation.</p> <!-- @@@toPem --> <!-- $$$version[overload1]$$$version --> <h3 class="fn"><a name="version"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QSslCertificate::<span class="name">version</span> () const</h3> <p>Returns the certificate's version string.</p> <!-- @@@version --> <!-- $$$operator!=[overload1]$$$operator!=constQSslCertificate& --> <h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QSslCertificate::<span class="name">operator!=</span> ( const <span class="type">QSslCertificate</span> & <i>other</i> ) const</h3> <p>Returns true if this certificate is not the same as <i>other</i>; otherwise returns false.</p> <!-- @@@operator!= --> <!-- $$$operator=[overload1]$$$operator=constQSslCertificate& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QSslCertificate</span> & QSslCertificate::<span class="name">operator=</span> ( const <span class="type">QSslCertificate</span> & <i>other</i> )</h3> <p>Copies the contents of <i>other</i> into this certificate, making the two certificates identical.</p> <!-- @@@operator= --> <!-- $$$operator==[overload1]$$$operator==constQSslCertificate& --> <h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QSslCertificate::<span class="name">operator==</span> ( const <span class="type">QSslCertificate</span> & <i>other</i> ) const</h3> <p>Returns true if this certificate is the same as <i>other</i>; otherwise returns false.</p> <!-- @@@operator== --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>