public class MessageDigestPasswordEncoder extends Object
| Constructor and Description |
|---|
MessageDigestPasswordEncoder(String algorithm)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
encodePassword(String password)
Encode (hash) a password.
|
static void |
main(String[] args)
To be used from commande line to hash password(s) using SHA-256
|
public static void main(String[] args) throws NoSuchAlgorithmException
args - String[]NoSuchAlgorithmException - Not possible for SHA-256public String encodePassword(String password) throws NoSuchAlgorithmException
password - String like password{SHA-256}c33d66fe65ffcca1f2260e6982dbf0c614b6ea3ddfdb37d6142fbec0feca5245NoSuchAlgorithmException - In case algorithm in constructor is not supportedCopyright © 2008–2024 Emeric Vernat. All rights reserved.