Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 1087

wt-doc-3.2.3-1.fc18.noarch.rpm

<!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>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Wt: Wt::Auth::PasswordVerifier Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a>      </li>
      <li class="navelem"><a class="el" href="namespaceWt_1_1Auth.html">Auth</a>      </li>
      <li class="navelem"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html">PasswordVerifier</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::Auth::PasswordVerifier Class Reference<div class="ingroups"><a class="el" href="group__auth.html">Authentication module (Wt::Auth)</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Wt::Auth::PasswordVerifier" --><!-- doxytag: inherits="Wt::Auth::PasswordService::AbstractVerifier" -->
<p>Password hash computation and verification class.  
 <a href="classWt_1_1Auth_1_1PasswordVerifier.html#details">More...</a></p>

<p><code>#include &lt;Wt/Auth/PasswordVerifier&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Wt::Auth::PasswordVerifier:</div>
<div class="dyncontent">
<div class="center"><img src="classWt_1_1Auth_1_1PasswordVerifier__inherit__graph.png" border="0" usemap="#Wt_1_1Auth_1_1PasswordVerifier_inherit__map" alt="Inheritance graph"/></div>
<map name="Wt_1_1Auth_1_1PasswordVerifier_inherit__map" id="Wt_1_1Auth_1_1PasswordVerifier_inherit__map">
<area shape="rect" href="classWt_1_1Auth_1_1PasswordService_1_1AbstractVerifier.html" title="Abstract password hash computation and verification class." alt="" coords="5,5,283,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classWt_1_1Auth_1_1PasswordVerifier-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3aa61534cbd936e01599d55dfe001d23"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::PasswordVerifier" ref="a3aa61534cbd936e01599d55dfe001d23" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a3aa61534cbd936e01599d55dfe001d23">PasswordVerifier</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab38ab679eab4c6ea49dd92d2d91d1bb"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::~PasswordVerifier" ref="aab38ab679eab4c6ea49dd92d2d91d1bb" args="()" -->
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#aab38ab679eab4c6ea49dd92d2d91d1bb">~PasswordVerifier</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a8fdc288c1d54b7e0dedbab982ad4bf26">setSaltLength</a> (int words)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the salt length.  <a href="#a8fdc288c1d54b7e0dedbab982ad4bf26"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acf9b36387f47af8280899b5150ec5c9f"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::saltLength" ref="acf9b36387f47af8280899b5150ec5c9f" args="() const " -->
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#acf9b36387f47af8280899b5150ec5c9f">saltLength</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the salt length. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#ae96fed853a42e5048bed6a5f01ca4f52">addHashFunction</a> (<a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> *function)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a hash function.  <a href="#ae96fed853a42e5048bed6a5f01ca4f52"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::vector<br class="typebreak"/>
&lt; <a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> * &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#ab34e7e05778ed00eb041dbd8555523de">hashFunctions</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the list of hash functions.  <a href="#ab34e7e05778ed00eb041dbd8555523de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a4343c6775285048deff597c8d5aff0b3">needsUpdate</a> (const <a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a> &amp;hash) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether a password hash needs to be updated (recomputed).  <a href="#a4343c6775285048deff597c8d5aff0b3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a9b559363b853793a8e9a2d9b04425898">hashPassword</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;password) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the password hash for a clear text password.  <a href="#a9b559363b853793a8e9a2d9b04425898"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#aa7685632890548b7f3a02422ceef9ba2">verify</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;password, const <a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a> &amp;hash) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies a password against a hash.  <a href="#aa7685632890548b7f3a02422ceef9ba2"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Password hash computation and verification class. </p>
<p>This class implements the logic for comparing passwords against password hashes, or computing a new password hash for a password.</p>
<p>One or more hash functions can be added, which allow you to introduce a new "preferred" hash function while maintaining support for verifying existing passwords hashes. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ae96fed853a42e5048bed6a5f01ca4f52"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::addHashFunction" ref="ae96fed853a42e5048bed6a5f01ca4f52" args="(HashFunction *function)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Auth::PasswordVerifier::addHashFunction </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> *&#160;</td>
          <td class="paramname"><em>function</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Adds a hash function. </p>
<p>The first hash function added is the one that will be used for creating new password hashes, i.e. the "preferred" hash function. The other hash functions are used only for verifying existing hash passwords. This allows you to move to new hash functions as other ones are no longer deemed secure.</p>
<p>Each hash function has a unique name, which is annotated in the generated hash to identify the appropriate hash funtion to evaluate it.</p>
<p>Ownership of the hash functions is transferred.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#ab34e7e05778ed00eb041dbd8555523de" title="Returns the list of hash functions.">hashFunctions()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab34e7e05778ed00eb041dbd8555523de"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::hashFunctions" ref="ab34e7e05778ed00eb041dbd8555523de" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::vector&lt;<a class="el" href="classWt_1_1Auth_1_1HashFunction.html">HashFunction</a> *&gt;&amp; Wt::Auth::PasswordVerifier::hashFunctions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the list of hash functions. </p>
<p>This returns a list with references to hashfunctions that have been added with <a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#ae96fed853a42e5048bed6a5f01ca4f52" title="Adds a hash function.">addHashFunction()</a>. </p>

</div>
</div>
<a class="anchor" id="a9b559363b853793a8e9a2d9b04425898"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::hashPassword" ref="a9b559363b853793a8e9a2d9b04425898" args="(const WString &amp;password) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a> Wt::Auth::PasswordVerifier::hashPassword </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>password</em></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the password hash for a clear text password. </p>
<p>This creates new salt and applies the "preferred" hash function to the salt and clear text password to compute the hash.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#aa7685632890548b7f3a02422ceef9ba2" title="Verifies a password against a hash.">verify()</a> </dd></dl>

<p>Implements <a class="el" href="classWt_1_1Auth_1_1PasswordService_1_1AbstractVerifier.html#a6c0edcfd38d6c4a656ffded44b007023">Wt::Auth::PasswordService::AbstractVerifier</a>.</p>

</div>
</div>
<a class="anchor" id="a4343c6775285048deff597c8d5aff0b3"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::needsUpdate" ref="a4343c6775285048deff597c8d5aff0b3" args="(const PasswordHash &amp;hash) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Auth::PasswordVerifier::needsUpdate </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a> &amp;&#160;</td>
          <td class="paramname"><em>hash</em></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether a password hash needs to be updated (recomputed). </p>
<p>A <code>hash</code> may need to be updated if it has been computed with a cryptographic method that is being disfavoured. </p>

<p>Implements <a class="el" href="classWt_1_1Auth_1_1PasswordService_1_1AbstractVerifier.html#a9991518e71092b356ae4e66fede088c3">Wt::Auth::PasswordService::AbstractVerifier</a>.</p>

</div>
</div>
<a class="anchor" id="a8fdc288c1d54b7e0dedbab982ad4bf26"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::setSaltLength" ref="a8fdc288c1d54b7e0dedbab982ad4bf26" args="(int words)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Auth::PasswordVerifier::setSaltLength </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>words</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the salt length. </p>
<p>The salt length is used to create new salt when a new password is being hashed.</p>
<p>The salt length is specified in bytes, but should be a multiple of 3 (so that Base64 encoding yields an integral number of bytes).</p>
<p>The default length is 12.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a9b559363b853793a8e9a2d9b04425898" title="Computes the password hash for a clear text password.">hashPassword()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa7685632890548b7f3a02422ceef9ba2"></a><!-- doxytag: member="Wt::Auth::PasswordVerifier::verify" ref="aa7685632890548b7f3a02422ceef9ba2" args="(const WString &amp;password, const PasswordHash &amp;hash) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Auth::PasswordVerifier::verify </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&#160;</td>
          <td class="paramname"><em>password</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1Auth_1_1PasswordHash.html">PasswordHash</a> &amp;&#160;</td>
          <td class="paramname"><em>hash</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Verifies a password against a hash. </p>
<p>This verifies whether the password matches the hash.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Auth_1_1PasswordVerifier.html#a9b559363b853793a8e9a2d9b04425898" title="Computes the password hash for a clear text password.">hashPassword()</a> </dd></dl>

<p>Implements <a class="el" href="classWt_1_1Auth_1_1PasswordService_1_1AbstractVerifier.html#a90b8136ba2c6f77fe420445653f56a6a">Wt::Auth::PasswordService::AbstractVerifier</a>.</p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>