Java Doc for PasswordEncoder.java in  » Security » acegi-security » org » acegisecurity » providers » encoding » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Security » acegi security » org.acegisecurity.providers.encoding 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.acegisecurity.providers.encoding.PasswordEncoder

All known Subclasses:   org.acegisecurity.providers.ldap.authenticator.LdapShaPasswordEncoder,  org.acegisecurity.providers.encoding.BasePasswordEncoder,
PasswordEncoder
public interface PasswordEncoder (Code)

Interface for performing authentication operations on a password.


author:
   colin sampaleanu
version:
   $Id: PasswordEncoder.java 1784 2007-02-24 21:00:24Z luke_t $




Method Summary
 StringencodePassword(String rawPass, Object salt)
    

Encodes the specified raw password with an implementation specific algorithm.

This will generally be a one-way message digest such as MD5 or SHA, but may also be a plaintext variant which does no encoding at all, but rather returns the same password it was fed.

 booleanisPasswordValid(String encPass, String rawPass, Object salt)
    

Validates a specified "raw" password against an encoded password.

The encoded password should have previously been generated by PasswordEncoder.encodePassword(String,Object) .




Method Detail
encodePassword
String encodePassword(String rawPass, Object salt) throws DataAccessException(Code)

Encodes the specified raw password with an implementation specific algorithm.

This will generally be a one-way message digest such as MD5 or SHA, but may also be a plaintext variant which does no encoding at all, but rather returns the same password it was fed. The latter is useful to plug in when the original password must be stored as-is.

The specified salt will potentially be used by the implementation to "salt" the initial value before encoding. A salt is usually a user-specific value which is added to the password before the digest is computed. This means that computation of digests for common dictionary words will be different than those in the backend store, because the dictionary word digests will not reflect the addition of the salt. If a per-user salt is used (rather than a system-wide salt), it also means users with the same password will have different digest encoded passwords in the backend store.

If a salt value is provided, the same salt value must be use when calling the PasswordEncoder.isPasswordValid(String,String,Object) method. Note that a specific implementation may choose to ignore the salt value (via null), or provide its own.


Parameters:
  rawPass - the password to encode
Parameters:
  salt - optionally used by the implementation to "salt" the raw password before encoding. Anull value is legal. encoded password
throws:
  DataAccessException - DOCUMENT ME!



isPasswordValid
boolean isPasswordValid(String encPass, String rawPass, Object salt) throws DataAccessException(Code)

Validates a specified "raw" password against an encoded password.

The encoded password should have previously been generated by PasswordEncoder.encodePassword(String,Object) . This method will encode the rawPass (using the optional salt), and then compared it with the presented encPass.

For a discussion of salts, please refer to PasswordEncoder.encodePassword(String,Object) .


Parameters:
  encPass - a pre-encoded password
Parameters:
  rawPass - a raw password to encode and compare against the pre-encoded password
Parameters:
  salt - optionally used by the implementation to "salt" the raw password before encoding. Anull value is legal. true if the password is valid , false otherwise
throws:
  DataAccessException - DOCUMENT ME!



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.