| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <title>PasswordHash</title> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PasswordHash"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":6,"i1":18,"i2":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../javax/security/enterprise/identitystore/LdapIdentityStoreDefinition.LdapSearchScope.html" title="enum in javax.security.enterprise.identitystore"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../javax/security/enterprise/identitystore/Pbkdf2PasswordHash.html" title="interface in javax.security.enterprise.identitystore"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?javax/security/enterprise/identitystore/PasswordHash.html" target="_top">Frames</a></li> |
| <li><a href="PasswordHash.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">javax.security.enterprise.identitystore</div> |
| <h2 title="Interface PasswordHash" class="title">Interface PasswordHash</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Known Subinterfaces:</dt> |
| <dd><a href="../../../../javax/security/enterprise/identitystore/Pbkdf2PasswordHash.html" title="interface in javax.security.enterprise.identitystore">Pbkdf2PasswordHash</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="typeNameLabel">PasswordHash</span></pre> |
| <div class="block"><code>PasswordHash</code> is an interface for objects that can generate and verify password hashes. |
| <p> |
| Implementations of <code>PasswordHash</code> are configured for the built-in Database <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a> |
| by configuring the type on the <a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html" title="annotation in javax.security.enterprise.identitystore"><code>DatabaseIdentityStoreDefinition</code></a> annotation. |
| Parameters for the <code>PasswordHash</code> can also be configured on the annotation, |
| and will be passed to the <a href="../../../../javax/security/enterprise/identitystore/PasswordHash.html#initialize-java.util.Map-"><code>initialize(Map)</code></a> method when the <a href="../../../../javax/security/enterprise/identitystore/IdentityStore.html" title="interface in javax.security.enterprise.identitystore"><code>IdentityStore</code></a> is initialized.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html#hashAlgorithm--"><code>DatabaseIdentityStoreDefinition.hashAlgorithm()</code></a>, |
| <a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html#hashAlgorithmParameters--"><code>DatabaseIdentityStoreDefinition.hashAlgorithmParameters()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/PasswordHash.html#generate-char:A-">generate</a></span>(char[] password)</code> |
| <div class="block">Generate an encoded password hash value for storage in a user's account.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>default void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/PasswordHash.html#initialize-java.util.Map-">initialize</a></span>(java.util.Map<java.lang.String,java.lang.String> parameters)</code> |
| <div class="block">Initialize the instance with the parameters it should use to |
| generate and verify password hashes.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/security/enterprise/identitystore/PasswordHash.html#verify-char:A-java.lang.String-">verify</a></span>(char[] password, |
| java.lang.String hashedPassword)</code> |
| <div class="block">Verify a password against the hashed password value retrieved from a user's account.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="initialize-java.util.Map-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>initialize</h4> |
| <pre>default void initialize(java.util.Map<java.lang.String,java.lang.String> parameters)</pre> |
| <div class="block">Initialize the instance with the parameters it should use to |
| generate and verify password hashes. The parameters are the |
| name/value pairs specified with the |
| <a href="../../../../javax/security/enterprise/identitystore/DatabaseIdentityStoreDefinition.html#hashAlgorithmParameters--"><code>DatabaseIdentityStoreDefinition.hashAlgorithmParameters()</code></a> |
| attribute. |
| <p> |
| An implementation is not required to support parameters, and may |
| ignore parameters passed to it. It is also possible that an implementation |
| will use the specified parameters when generating a new password hash, |
| but ignore them in favor of parameters stored with an existing password |
| hash when verifying. |
| <p> |
| If no parameters were supplied, the argument is an empty <code>Map</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>parameters</code> - A <code>Map</code> of the provided parameters, empty if no parameters were supplied.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="generate-char:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>generate</h4> |
| <pre>java.lang.String generate(char[] password)</pre> |
| <div class="block">Generate an encoded password hash value for storage in a user's account. |
| <p> |
| This method should not be used to generate a password hash for verification purposes; |
| use <a href="../../../../javax/security/enterprise/identitystore/PasswordHash.html#verify-char:A-java.lang.String-"><code>verify(char[], String)</code></a> for that purpose. Use this method only to generate |
| password hashes for new or changed passwords. |
| <p> |
| The returned hash value should be fully encoded, such that it can be directly stored, as is, |
| with no additional formatting or encoding applied.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>password</code> - The password to generate a hash for.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The generated password hash value.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="verify-char:A-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>verify</h4> |
| <pre>boolean verify(char[] password, |
| java.lang.String hashedPassword)</pre> |
| <div class="block">Verify a password against the hashed password value retrieved from a user's account. |
| <p> |
| The <code>hashedPassword</code> parameter should be provided exactly as retrieved from the database, |
| with no decoding or formatting applied. The <code>password</code> parameter should be hashed and |
| compared to the hashed password.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>password</code> - The password to verify.</dd> |
| <dd><code>hashedPassword</code> - The hashed password to compare against.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>True if the password matched the hashed password, false otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../javax/security/enterprise/identitystore/LdapIdentityStoreDefinition.LdapSearchScope.html" title="enum in javax.security.enterprise.identitystore"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../javax/security/enterprise/identitystore/Pbkdf2PasswordHash.html" title="interface in javax.security.enterprise.identitystore"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?javax/security/enterprise/identitystore/PasswordHash.html" target="_top">Frames</a></li> |
| <li><a href="PasswordHash.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |