本文整理汇总了Java中org.jivesoftware.openfire.auth.AuthFactory.decryptPassword方法的典型用法代码示例。如果您正苦于以下问题:Java AuthFactory.decryptPassword方法的具体用法?Java AuthFactory.decryptPassword怎么用?Java AuthFactory.decryptPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.openfire.auth.AuthFactory
的用法示例。
在下文中一共展示了AuthFactory.decryptPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDecrypted
import org.jivesoftware.openfire.auth.AuthFactory; //导入方法依赖的package包/类
@Override
public String getDecrypted(String value) {
String decrypted = null;
try {
decrypted = AuthFactory.decryptPassword(value);
// Set password to null so that it's inserted that way.
} catch (UnsupportedOperationException uoe) {
// Encrypting the apiKey may have failed. Therefore,
}
return decrypted;
}
示例2: getDecrypted
import org.jivesoftware.openfire.auth.AuthFactory; //导入方法依赖的package包/类
/**
* Decrypt a string using openfire AuthFactory
* @param value
* @return
*/
protected String getDecrypted(String value) {
String decrypted = null;
try {
decrypted = AuthFactory.decryptPassword(value);
} catch (UnsupportedOperationException uoe) {
}
return decrypted;
}
示例3: loadFromDb
import org.jivesoftware.openfire.auth.AuthFactory; //导入方法依赖的package包/类
/**
* Load registration from database.
*
* @throws NotFoundException if registration was not found in database.
*/
private void loadFromDb() throws NotFoundException {
if (disconnectedMode) { return; }
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(LOAD_REGISTRATION);
pstmt.setLong(1, registrationID);
rs = pstmt.executeQuery();
if (!rs.next()) {
throw new NotFoundException("Registration not found: " + registrationID);
}
this.jid = new JID(rs.getString(1));
this.transportType = TransportType.valueOf(rs.getString(2));
this.username = rs.getString(3);
// The password is stored in encrypted form, so decrypt it.
this.password = AuthFactory.decryptPassword(rs.getString(4));
this.nickname = rs.getString(5);
this.registrationDate = new Date(rs.getLong(6));
long loginDate = rs.getLong(7);
if (rs.wasNull()) {
this.lastLogin = null;
}
else {
this.lastLogin = new Date(loginDate);
}
}
catch (SQLException sqle) {
Log.error(sqle);
}
finally {
DbConnectionManager.closeConnection(rs, pstmt, con);
}
}