1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Crypto::X509Certificate</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Crypto.html" class="namespace">Poco::Crypto</a></h1>
<h1 class="symbol">class X509Certificate</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Crypto<br />
<b>Package:</b> Certificate<br />
<b>Header:</b> Poco/Crypto/X509Certificate.h</p>
<h2>Description</h2>
<div class="description">
<p>This class represents a X509 Certificate. </p>
</div>
<h2>Inheritance</h2>
<p><b>Known Derived Classes: </b><a href="Poco.Net.X509Certificate.html" title="class Poco::Net::X509Certificate">Poco::Net::X509Certificate</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Crypto.X509Certificate.html#376" title="Poco::Crypto::X509Certificate::certificate()">certificate</a>, <a href="Poco.Crypto.X509Certificate.html#364" title="Poco::Crypto::X509Certificate::commonName()">commonName</a>, <a href="Poco.Crypto.X509Certificate.html#369" title="Poco::Crypto::X509Certificate::expiresOn()">expiresOn</a>, <a href="Poco.Crypto.X509Certificate.html#365" title="Poco::Crypto::X509Certificate::extractNames()">extractNames</a>, <a href="Poco.Crypto.X509Certificate.html#381" title="Poco::Crypto::X509Certificate::init()">init</a>, <a href="Poco.Crypto.X509Certificate.html#374" title="Poco::Crypto::X509Certificate::issuedBy()">issuedBy</a>, <a href="Poco.Crypto.X509Certificate.html#358" title="Poco::Crypto::X509Certificate::issuerName()">issuerName</a>, <a href="Poco.Crypto.X509Certificate.html#377" title="Poco::Crypto::X509Certificate::load()">load</a>, <a href="Poco.Crypto.X509Certificate.html#353" title="Poco::Crypto::X509Certificate::operator =()">operator =</a>, <a href="Poco.Crypto.X509Certificate.html#370" title="Poco::Crypto::X509Certificate::save()">save</a>, <a href="Poco.Crypto.X509Certificate.html#361" title="Poco::Crypto::X509Certificate::subjectName()">subjectName</a>, <a href="Poco.Crypto.X509Certificate.html#355" title="Poco::Crypto::X509Certificate::swap()">swap</a>, <a href="Poco.Crypto.X509Certificate.html#368" title="Poco::Crypto::X509Certificate::validFrom()">validFrom</a></p>
<h2>Enumerations</h2>
<h3><a name="338">NID</a></h3>
<div class="description">
<p>Name identifier for extracting information from a certificate subject's or issuer's distinguished name. </p>
</div>
<p class="decl"><a name="339">NID_COMMON_NAME</a> = 13</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="340">NID_COUNTRY</a> = 14</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="341">NID_LOCALITY_NAME</a> = 15</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="342">NID_STATE_OR_PROVINCE</a> = 16</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="343">NID_ORGANIZATION_NAME</a> = 17</p>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="344">NID_ORGANIZATION_UNIT_NAME</a> = 18</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="345">X509Certificate</a></h3>
<p class="decl">explicit <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>(<br /> std::istream & istr<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> object by reading a certificate in PEM format from a stream. </p>
</div>
<h3><a name="347">X509Certificate</a></h3>
<p class="decl">explicit <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>(<br /> const std::string & path<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> object by reading a certificate in PEM format from a file. </p>
</div>
<h3><a name="349">X509Certificate</a></h3>
<p class="decl">explicit <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>(<br /> X509 * pCert<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> from an existing OpenSSL certificate. Ownership is taken of the certificate. </p>
</div>
<h3><a name="351">X509Certificate</a></h3>
<p class="decl"><a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>(<br /> const <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> & cert<br />);</p>
<div class="description">
<p>Creates the certificate by copying another one. </p>
</div>
<h2>Destructor</h2>
<h3><a name="357">~X509Certificate</a></h3>
<p class="decl">~<a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="376">certificate</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const X509 * certificate() const;</p>
<div class="description">
<p>Returns the underlying OpenSSL certificate. </p>
</div>
<h3><a name="364">commonName</a></h3>
<p class="decl">std::string commonName() const;</p>
<div class="description">
<p>Returns the common name stored in the certificate subject's distinguished name. </p>
</div>
<h3><a name="369">expiresOn</a></h3>
<p class="decl"><a href="Poco.DateTime.html" title="class Poco::DateTime">Poco::DateTime</a> expiresOn() const;</p>
<div class="description">
<p>Returns the date and time the certificate expires. </p>
</div>
<h3><a name="365">extractNames</a></h3>
<p class="decl">void extractNames(<br /> std::string & commonName,<br /> std::set < std::string > & domainNames<br />) const;</p>
<div class="description">
<p>Extracts the common name and the alias domain names from the certificate. </p>
</div>
<h3><a name="374">issuedBy</a></h3>
<p class="decl">bool issuedBy(<br /> const <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> & issuerCertificate<br />) const;</p>
<div class="description">
<p>Checks whether the certificate has been issued by the issuer given by issuerCertificate. This can be used to validate a certificate chain. </p>
<p>Verifies if the certificate has been signed with the issuer's private key, using the public key from the issuer certificate. </p>
<p>Returns true if verification against the issuer certificate was successfull, false otherwise. </p>
</div>
<h3><a name="358">issuerName</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & issuerName() const;</p>
<div class="description">
<p>Returns the certificate issuer's distinguished name. </p>
</div>
<h3><a name="359">issuerName</a></h3>
<p class="decl">std::string issuerName(<br /> <a href="Poco.Crypto.X509Certificate.html#338" title="enum Poco::Crypto::X509Certificate::NID">NID</a> nid<br />) const;</p>
<div class="description">
<p>Extracts the information specified by the given <a href="Poco.Crypto.X509Certificate.html#338" title="enum Poco::Crypto::X509Certificate::NID">NID</a> (name identifier) from the certificate issuer's distinguished name. </p>
</div>
<h3><a name="353">operator =</a></h3>
<p class="decl"><a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> & operator = (<br /> const <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> & cert<br />);</p>
<div class="description">
<p>Assigns a certificate. </p>
</div>
<h3><a name="370">save</a></h3>
<p class="decl">void save(<br /> std::ostream & stream<br />) const;</p>
<div class="description">
<p>Writes the certificate to the given stream. The certificate is written in PEM format. </p>
</div>
<h3><a name="372">save</a></h3>
<p class="decl">void save(<br /> const std::string & path<br />) const;</p>
<div class="description">
<p>Writes the certificate to the file given by path. The certificate is written in PEM format. </p>
</div>
<h3><a name="361">subjectName</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & subjectName() const;</p>
<div class="description">
<p>Returns the certificate subject's distinguished name. </p>
</div>
<h3><a name="362">subjectName</a></h3>
<p class="decl">std::string subjectName(<br /> <a href="Poco.Crypto.X509Certificate.html#338" title="enum Poco::Crypto::X509Certificate::NID">NID</a> nid<br />) const;</p>
<div class="description">
<p>Extracts the information specified by the given <a href="Poco.Crypto.X509Certificate.html#338" title="enum Poco::Crypto::X509Certificate::NID">NID</a> (name identifier) from the certificate subject's distinguished name. </p>
</div>
<h3><a name="355">swap</a></h3>
<p class="decl">void swap(<br /> <a href="Poco.Crypto.X509Certificate.html" title="class Poco::Crypto::X509Certificate">X509Certificate</a> & cert<br />);</p>
<div class="description">
<p>Exchanges the certificate with another one. </p>
</div>
<h3><a name="368">validFrom</a></h3>
<p class="decl"><a href="Poco.DateTime.html" title="class Poco::DateTime">Poco::DateTime</a> validFrom() const;</p>
<div class="description">
<p>Returns the date and time the certificate is valid from. </p>
</div>
<h3><a name="381">init</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void init();</p>
<div class="description">
<p>Extracts issuer and subject name from the certificate. </p>
</div>
<h3><a name="377">load</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void load(<br /> std::istream & stream<br />);</p>
<div class="description">
<p>Loads the certificate from the given stream. The certificate must be in PEM format. </p>
</div>
<h3><a name="379">load</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void load(<br /> const std::string & path<br />);</p>
<div class="description">
<p>Loads the certificate from the given file. The certificate must be in PEM format. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|