| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>DefaultPasswordService (Apache Shiro 1.13.0 API)</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="DefaultPasswordService (Apache Shiro 1.13.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- Matomo --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ /* We explicitly disable cookie tracking to avoid privacy issues */ _paq.push(['disableCookies']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//matomo.privacy.apache.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '2']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> |
| <!-- ========= 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="class-use/DefaultPasswordService.html">Use</a></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="../../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/authc/credential/HashedCredentialsMatcher.html" title="class in org.apache.shiro.authc.credential"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/authc/credential/DefaultPasswordService.html" target="_top">Frames</a></li> |
| <li><a href="DefaultPasswordService.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><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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">org.apache.shiro.authc.credential</div> |
| <h2 title="Class DefaultPasswordService" class="title">Class DefaultPasswordService</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.shiro.authc.credential.DefaultPasswordService</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html" title="interface in org.apache.shiro.authc.credential">HashingPasswordService</a>, <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html" title="interface in org.apache.shiro.authc.credential">PasswordService</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.43">DefaultPasswordService</a> |
| extends <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> |
| implements <a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html" title="interface in org.apache.shiro.authc.credential">HashingPasswordService</a></pre> |
| <div class="block">Default implementation of the <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html" title="interface in org.apache.shiro.authc.credential"><code>PasswordService</code></a> interface that relies on an internal |
| <a href="../../../../../org/apache/shiro/crypto/hash/HashService.html" title="interface in org.apache.shiro.crypto.hash"><code>HashService</code></a>, <a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormat</code></a>, and <a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format"><code>HashFormatFactory</code></a> to function: |
| <h2>Hashing Passwords</h2> |
| |
| <h2>Comparing Passwords</h2> |
| All hashing operations are performed by the internal <a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#getHashService--"><code>hashService</code></a>. After the hash |
| is computed, it is formatted into a String value via the internal <a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#getHashFormat--"><code>hashFormat</code></a>.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.2</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#DEFAULT_HASH_ALGORITHM">DEFAULT_HASH_ALGORITHM</a></span></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#DEFAULT_HASH_ITERATIONS">DEFAULT_HASH_ITERATIONS</a></span></code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#DefaultPasswordService--">DefaultPasswordService</a></span>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== 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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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>protected <a href="../../../../../org/apache/shiro/crypto/hash/HashRequest.html" title="interface in org.apache.shiro.crypto.hash">HashRequest</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#buildHashRequest-org.apache.shiro.util.ByteSource-org.apache.shiro.crypto.hash.Hash-">buildHashRequest</a></span>(<a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a> plaintext, |
| <a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a> saved)</code> </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#checkHashFormatDurability--">checkHashFormatDurability</a></span>()</code> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#createByteSource-java.lang.Object-">createByteSource</a></span>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/crypto/hash/HashRequest.html" title="interface in org.apache.shiro.crypto.hash">HashRequest</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#createHashRequest-org.apache.shiro.util.ByteSource-">createHashRequest</a></span>(<a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a> plaintext)</code> </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#encryptPassword-java.lang.Object-">encryptPassword</a></span>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext)</code> |
| <div class="block">Converts the specified plaintext password (usually acquired from your application's 'new user' or 'password reset' |
| workflow) into a formatted string safe for storage.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#getHashFormat--">getHashFormat</a></span>()</code> </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#getHashFormatFactory--">getHashFormatFactory</a></span>()</code> </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/crypto/hash/HashService.html" title="interface in org.apache.shiro.crypto.hash">HashService</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#getHashService--">getHashService</a></span>()</code> </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#hashPassword-java.lang.Object-">hashPassword</a></span>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext)</code> |
| <div class="block">Hashes the specified plaintext password using internal hashing configuration settings pertinent to password |
| hashing.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#passwordsMatch-java.lang.Object-org.apache.shiro.crypto.hash.Hash-">passwordsMatch</a></span>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext, |
| <a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a> saved)</code> |
| <div class="block">Returns <code>true</code> if the <code>submittedPlaintext</code> password matches the existing <code>savedPasswordHash</code>, |
| <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#passwordsMatch-java.lang.Object-java.lang.String-">passwordsMatch</a></span>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> submittedPlaintext, |
| <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> saved)</code> |
| <div class="block">Returns <code>true</code> if the <code>submittedPlaintext</code> password matches the existing <code>saved</code> password, |
| <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#setHashFormat-org.apache.shiro.crypto.hash.format.HashFormat-">setHashFormat</a></span>(<a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a> hashFormat)</code> </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#setHashFormatFactory-org.apache.shiro.crypto.hash.format.HashFormatFactory-">setHashFormatFactory</a></span>(<a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a> hashFormatFactory)</code> </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/authc/credential/DefaultPasswordService.html#setHashService-org.apache.shiro.crypto.hash.HashService-">setHashService</a></span>(<a href="../../../../../org/apache/shiro/crypto/hash/HashService.html" title="interface in org.apache.shiro.crypto.hash">HashService</a> hashService)</code> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="DEFAULT_HASH_ALGORITHM"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DEFAULT_HASH_ALGORITHM</h4> |
| <pre>public static final <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.45">DEFAULT_HASH_ALGORITHM</a></pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.shiro.authc.credential.DefaultPasswordService.DEFAULT_HASH_ALGORITHM">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="DEFAULT_HASH_ITERATIONS"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DEFAULT_HASH_ITERATIONS</h4> |
| <pre>public static final int <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.46">DEFAULT_HASH_ITERATIONS</a></pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../constant-values.html#org.apache.shiro.authc.credential.DefaultPasswordService.DEFAULT_HASH_ITERATIONS">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="DefaultPasswordService--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DefaultPasswordService</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.56">DefaultPasswordService</a>()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="encryptPassword-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>encryptPassword</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.69">encryptPassword</a>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext)</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-">PasswordService</a></code></span></div> |
| <div class="block">Converts the specified plaintext password (usually acquired from your application's 'new user' or 'password reset' |
| workflow) into a formatted string safe for storage. The returned string can be safely saved with the |
| corresponding user account record (e.g. as a 'password' attribute). |
| <p/> |
| It is expected that the String returned from this method will be presented to the |
| <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#passwordsMatch-java.lang.Object-java.lang.String-"><code>passwordsMatch(plaintext,encrypted)</code></a> method when performing a |
| password comparison check. |
| <h3>Usage</h3> |
| The input argument type can be any 'byte backed' <code>Object</code> - almost always either a |
| String or character array representing passwords (character arrays are often a safer way to represent passwords |
| as they can be cleared/nulled-out after use. Any argument type supported by |
| <code>ByteSource.Util#isCompatible(Object)</code> is valid. |
| <p/> |
| For example: |
| <pre> |
| String rawPassword = ... |
| String encryptedValue = passwordService.encryptPassword(rawPassword); |
| </pre> |
| or, identically: |
| <pre> |
| char[] rawPasswordChars = ... |
| String encryptedValue = passwordService.encryptPassword(rawPasswordChars); |
| </pre> |
| <p/> |
| The resulting <code>encryptedValue</code> should be stored with the account to be retrieved later during a |
| login attempt. For example: |
| <pre> |
| String encryptedValue = passwordService.encryptPassword(rawPassword); |
| ... |
| userAccount.setPassword(encryptedValue); |
| userAccount.save(); //create or update to your data store |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-">encryptPassword</a></code> in interface <code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html" title="interface in org.apache.shiro.authc.credential">PasswordService</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>plaintext</code> - the raw password as 'byte-backed' object (String, character array, <a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util"><code>ByteSource</code></a>, |
| etc) usually acquired from your application's 'new user' or 'password reset' workflow.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the encrypted password, formatted for storage.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>ByteSource.Util#isCompatible(Object)</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="hashPassword-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashPassword</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.75">hashPassword</a>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext)</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html#hashPassword-java.lang.Object-">HashingPasswordService</a></code></span></div> |
| <div class="block">Hashes the specified plaintext password using internal hashing configuration settings pertinent to password |
| hashing. |
| <p/> |
| Note |
| that this method is only likely to be used in more complex environments that wish to format and/or save the |
| returned <code>Hash</code> object in a custom manner. Most applications will find the |
| <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-"><code>encryptPassword</code></a> method suitable enough for safety |
| and ease-of-use. |
| <h3>Usage</h3> |
| The input argument type can be any 'byte backed' <code>Object</code> - almost always either a |
| String or character array representing passwords (character arrays are often a safer way to represent passwords |
| as they can be cleared/nulled-out after use. Any argument type supported by |
| <code>ByteSource.Util#isCompatible(Object)</code> is valid. |
| <p/> |
| Regardless of your choice of using Strings or character arrays to represent submitted passwords, you can wrap |
| either as a <code>ByteSource</code> by using <code>ByteSource.Util</code>, for example, when the passwords are captured as |
| Strings: |
| <pre> |
| ByteSource passwordBytes = ByteSource.Util.bytes(submittedPasswordString); |
| Hash hashedPassword = hashingPasswordService.hashPassword(passwordBytes); |
| </pre> |
| or, identically, when captured as a character array: |
| <pre> |
| ByteSource passwordBytes = ByteSource.Util.bytes(submittedPasswordCharacterArray); |
| Hash hashedPassword = hashingPasswordService.hashPassword(passwordBytes); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html#hashPassword-java.lang.Object-">hashPassword</a></code> in interface <code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html" title="interface in org.apache.shiro.authc.credential">HashingPasswordService</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>plaintext</code> - the raw password as 'byte-backed' object (String, character array, <a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util"><code>ByteSource</code></a>, |
| etc) usually acquired from your application's 'new user' or 'password reset' workflow.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the hashed password.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>ByteSource.Util#isCompatible(Object)</code>, |
| <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-"><code>PasswordService.encryptPassword(Object)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="passwordsMatch-java.lang.Object-org.apache.shiro.crypto.hash.Hash-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>passwordsMatch</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.84">passwordsMatch</a>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> plaintext, |
| <a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a> saved)</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html#passwordsMatch-java.lang.Object-org.apache.shiro.crypto.hash.Hash-">HashingPasswordService</a></code></span></div> |
| <div class="block">Returns <code>true</code> if the <code>submittedPlaintext</code> password matches the existing <code>savedPasswordHash</code>, |
| <code>false</code> otherwise. Note that this method is only likely to be used in more complex environments that |
| save hashes in a custom manner. Most applications will find the |
| <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#passwordsMatch-java.lang.Object-java.lang.String-"><code>passwordsMatch(plaintext,string)</code></a> method |
| sufficient if <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-"><code>encrypting passwords as Strings</code></a>. |
| <h3>Usage</h3> |
| The <code>submittedPlaintext</code> argument type can be any 'byte backed' <code>Object</code> - almost always either a |
| String or character array representing passwords (character arrays are often a safer way to represent passwords |
| as they can be cleared/nulled-out after use. Any argument type supported by |
| <code>ByteSource.Util#isCompatible(Object)</code> is valid.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html#passwordsMatch-java.lang.Object-org.apache.shiro.crypto.hash.Hash-">passwordsMatch</a></code> in interface <code><a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html" title="interface in org.apache.shiro.authc.credential">HashingPasswordService</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>plaintext</code> - a raw/plaintext password submitted by an end user/Subject.</dd> |
| <dd><code>saved</code> - the previously hashed password known to be associated with an account. |
| This value is expected to have been previously generated from the |
| <a href="../../../../../org/apache/shiro/authc/credential/HashingPasswordService.html#hashPassword-java.lang.Object-"><code>hashPassword</code></a> method (typically |
| when the account is created or the account's password is reset).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the <code>plaintext</code> password matches the existing <code>savedPasswordHash</code>, |
| <code>false</code> otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="checkHashFormatDurability--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkHashFormatDurability</h4> |
| <pre>protected void <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.110">checkHashFormatDurability</a>()</pre> |
| </li> |
| </ul> |
| <a name="createHashRequest-org.apache.shiro.util.ByteSource-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createHashRequest</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/crypto/hash/HashRequest.html" title="interface in org.apache.shiro.crypto.hash">HashRequest</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.128">createHashRequest</a>(<a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a> plaintext)</pre> |
| </li> |
| </ul> |
| <a name="createByteSource-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createByteSource</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.132">createByteSource</a>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> |
| </li> |
| </ul> |
| <a name="passwordsMatch-java.lang.Object-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>passwordsMatch</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.136">passwordsMatch</a>(<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> submittedPlaintext, |
| <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> saved)</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#passwordsMatch-java.lang.Object-java.lang.String-">PasswordService</a></code></span></div> |
| <div class="block">Returns <code>true</code> if the <code>submittedPlaintext</code> password matches the existing <code>saved</code> password, |
| <code>false</code> otherwise. |
| <h3>Usage</h3> |
| The <code>submittedPlaintext</code> argument type can be any 'byte backed' <code>Object</code> - almost always either a |
| String or character array representing passwords (character arrays are often a safer way to represent passwords |
| as they can be cleared/nulled-out after use. Any argument type supported by |
| <code>ByteSource.Util#isCompatible(Object)</code> is valid. |
| <p/> |
| For example: |
| <pre> |
| String submittedPassword = ... |
| passwordService.passwordsMatch(submittedPassword, encryptedPassword); |
| </pre> |
| or similarly: |
| <pre> |
| char[] submittedPasswordCharacters = ... |
| passwordService.passwordsMatch(submittedPasswordCharacters, encryptedPassword); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#passwordsMatch-java.lang.Object-java.lang.String-">passwordsMatch</a></code> in interface <code><a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html" title="interface in org.apache.shiro.authc.credential">PasswordService</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>submittedPlaintext</code> - a raw/plaintext password submitted by an end user/Subject.</dd> |
| <dd><code>saved</code> - the previously encrypted password known to be associated with an account. |
| This value is expected to have been previously generated from the |
| <a href="../../../../../org/apache/shiro/authc/credential/PasswordService.html#encryptPassword-java.lang.Object-"><code>encryptPassword</code></a> method (typically |
| when the account is created or the account's password is reset).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the <code>submittedPlaintext</code> password matches the existing <code>saved</code> password, |
| <code>false</code> otherwise.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>ByteSource.Util#isCompatible(Object)</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="buildHashRequest-org.apache.shiro.util.ByteSource-org.apache.shiro.crypto.hash.Hash-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>buildHashRequest</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/crypto/hash/HashRequest.html" title="interface in org.apache.shiro.crypto.hash">HashRequest</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.177">buildHashRequest</a>(<a href="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</a> plaintext, |
| <a href="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</a> saved)</pre> |
| </li> |
| </ul> |
| <a name="getHashService--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getHashService</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/crypto/hash/HashService.html" title="interface in org.apache.shiro.crypto.hash">HashService</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.187">getHashService</a>()</pre> |
| </li> |
| </ul> |
| <a name="setHashService-org.apache.shiro.crypto.hash.HashService-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setHashService</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.191">setHashService</a>(<a href="../../../../../org/apache/shiro/crypto/hash/HashService.html" title="interface in org.apache.shiro.crypto.hash">HashService</a> hashService)</pre> |
| </li> |
| </ul> |
| <a name="getHashFormat--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getHashFormat</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.195">getHashFormat</a>()</pre> |
| </li> |
| </ul> |
| <a name="setHashFormat-org.apache.shiro.crypto.hash.format.HashFormat-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setHashFormat</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.199">setHashFormat</a>(<a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormat.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormat</a> hashFormat)</pre> |
| </li> |
| </ul> |
| <a name="getHashFormatFactory--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getHashFormatFactory</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a> <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.203">getHashFormatFactory</a>()</pre> |
| </li> |
| </ul> |
| <a name="setHashFormatFactory-org.apache.shiro.crypto.hash.format.HashFormatFactory-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>setHashFormatFactory</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/authc/credential/DefaultPasswordService.html#line.207">setHashFormatFactory</a>(<a href="../../../../../org/apache/shiro/crypto/hash/format/HashFormatFactory.html" title="interface in org.apache.shiro.crypto.hash.format">HashFormatFactory</a> hashFormatFactory)</pre> |
| </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="class-use/DefaultPasswordService.html">Use</a></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="../../../../../org/apache/shiro/authc/credential/CredentialsMatcher.html" title="interface in org.apache.shiro.authc.credential"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/authc/credential/HashedCredentialsMatcher.html" title="class in org.apache.shiro.authc.credential"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/authc/credential/DefaultPasswordService.html" target="_top">Frames</a></li> |
| <li><a href="DefaultPasswordService.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><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2004–2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |