This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Re: password policy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Re: password policy" Watch "Re: password policy" New topic
Author

Re: password policy

Joe Cheung
Ranch Hand

Joined: Oct 18, 2002
Posts: 104
Dear all,

How can I implement my own password policy that the password must consists of at least one character (a-z or A-Z) and one numeric value (0-9) in Java?

Thanks!
Joe


Joe
Tom Tremain
Greenhorn

Joined: May 09, 2005
Posts: 1
A good place to start would be to read the javadocs for the the isDigit(char ch) and isLetter(char ch) static methods of the java.lang.Character class.

Using these methods inside of a loop should enable you to verify that a password meets the security requirements defined in your post.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Yosi Hendarsjah
Ranch Hand

Joined: Oct 02, 2003
Posts: 164
You can use regular expression.
 
GeeCON Prague 2014
 
subject: Re: password policy