use of org.olat.modules.fo.model.PseudonymImpl in project openolat by klemens.
the class ForumManager method createProtectedPseudonym.
public Pseudonym createProtectedPseudonym(String pseudonym, String password) {
PseudonymImpl pseudo = new PseudonymImpl();
pseudo.setCreationDate(new Date());
pseudo.setPseudonym(pseudonym);
Algorithm algorithm = loginModule.getDefaultHashAlgorithm();
String salt = algorithm.isSalted() ? Encoder.getSalt() : null;
String newCredentials = Encoder.encrypt(password, salt, algorithm);
pseudo.setSalt(salt);
pseudo.setCredential(newCredentials);
pseudo.setAlgorithm(algorithm.name());
dbInstance.getCurrentEntityManager().persist(pseudo);
return pseudo;
}
use of org.olat.modules.fo.model.PseudonymImpl in project OpenOLAT by OpenOLAT.
the class ForumManager method createProtectedPseudonym.
public Pseudonym createProtectedPseudonym(String pseudonym, String password) {
PseudonymImpl pseudo = new PseudonymImpl();
pseudo.setCreationDate(new Date());
pseudo.setPseudonym(pseudonym);
Algorithm algorithm = loginModule.getDefaultHashAlgorithm();
String salt = algorithm.isSalted() ? Encoder.getSalt() : null;
String newCredentials = Encoder.encrypt(password, salt, algorithm);
pseudo.setSalt(salt);
pseudo.setCredential(newCredentials);
pseudo.setAlgorithm(algorithm.name());
dbInstance.getCurrentEntityManager().persist(pseudo);
return pseudo;
}
Aggregations