Class CryptoCredential
java.lang.Object
com.easydesk.security.credentials.CryptoCredential
- All Implemented Interfaces:
CredentialService
EasyDesk Crypto service(
CryptoService) 의 algorithm 을 이용하여 사용자의 password 를
검증하고 설정하는 CredentialService.- Version:
- $Id$
- Author:
- Youngho Cho
-
Constructor Summary
ConstructorsConstructorDescriptionCryptoCredential(CryptoService cryptoService, String algorithm, UserManager userManager) CryptoCredential 을 생성한다. -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(User user, String password) Authenticate a user with the specified password.voidsetPassword(User user, String new_password) password 를 algorithm 으로 변환('iterate : salt : password' 형식)하여 UserManager 를 통해 저장한다.
-
Constructor Details
-
CryptoCredential
CryptoCredential 을 생성한다.- Parameters:
cryptoService- password 변환에 사용하는 Crypto servicealgorithm- 사용할 crypto algorithm 이름userManager- password 를 저장하는 UserManager
-
-
Method Details
-
authenticate
public boolean authenticate(User user, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException Authenticate a user with the specified password. If authentication is successful the method returns true. If it fails, it returns false.- Specified by:
authenticatein interfaceCredentialService- Parameters:
user- a User object.password- the user supplied password. (plain text)- Returns:
- 인증에 성공하면
true - Throws:
PasswordMismatchException- algorithm 을 찾을 수 없거나 검증 중 오류가 발생한 경우UnknownEntityException- 사용자가 존재하지 않는 경우DataBackendException- 저장소 접근 중 오류가 발생한 경우
-
setPassword
public void setPassword(User user, String new_password) throws UnknownEntityException, DataBackendException password 를 algorithm 으로 변환('iterate : salt : password' 형식)하여 UserManager 를 통해 저장한다.- Specified by:
setPasswordin interfaceCredentialService- Parameters:
user- 대상 사용자new_password- 새 password (plain text)- Throws:
UnknownEntityException- 사용자가 존재하지 않는 경우DataBackendException- algorithm 을 찾을 수 없거나 변환, 저장 중 오류가 발생한 경우
-