Class NoOpPasswordEncoder
java.lang.Object
com.codename1.backend.security.crypto.NoOpPasswordEncoder
- All Implemented Interfaces:
PasswordEncoder
Stores a password as it is: {noop}secret. For a demonstration or a test,
where the point is to read the password in the source.
It verifies only on a development profile. Anywhere else a {noop} password
matches nothing and the server says why once on standard error, because a
clear-text password that works in production is a configuration left over
from a laptop.
-
Method Summary
Modifier and TypeMethodDescriptionencode(CharSequence rawPassword) The password as it should be stored: salted and hashed, so encoding one password twice gives two different results.static NoOpPasswordEncoderbooleanmatches(CharSequence rawPassword, String encodedPassword) WhetherrawPasswordis the passwordencodedPasswordwas made from.static voidsetDevelopmentProfile(boolean value) Says whether this process runs on a development profile.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PasswordEncoder
upgradeEncoding
-
Method Details
-
getInstance
-
setDevelopmentProfile
public static void setDevelopmentProfile(boolean value) Says whether this process runs on a development profile. The security layer calls it from the configuration it is built with; a test that uses the encoder on its own calls it too. -
encode
Description copied from interface:PasswordEncoderThe password as it should be stored: salted and hashed, so encoding one password twice gives two different results.- Specified by:
encodein interfacePasswordEncoder
-
matches
Description copied from interface:PasswordEncoderWhetherrawPasswordis the passwordencodedPasswordwas made from.- Specified by:
matchesin interfacePasswordEncoder
-