Class PasswordAttribute

All Implemented Interfaces:
Viewable, Cacheable, Observed, Retrievable, Serializable, ColumnAccessByName, ObjectModel, Persistent

public class PasswordAttribute extends StringAttribute
DOCUMENT ME!
Version:
$id: PasswordAttribute.java $Revision$, 02-25-22 7:05:54 PM KST
Author:
YounghoCho
See Also:
  • Constructor Details

    • PasswordAttribute

      public PasswordAttribute()
      새로운 PasswordAttribute 인스턴스를 생성한다.
  • Method Details

    • setPassword

      public void setPassword(String plain) throws GeneralSecurityException
      plain text password 를 encryptPassword 로 변경 저장한다.
      Parameters:
      plain - text
      Throws:
      GeneralSecurityException - 암호화 중 오류가 발생한 경우
    • generateStorngPasswordHash

      protected String generateStorngPasswordHash(String password) throws NoSuchAlgorithmException, InvalidKeySpecException, GeneralSecurityException
      DOCUMENT ME!
      Parameters:
      password - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      NoSuchAlgorithmException - DOCUMENT ME!
      InvalidKeySpecException - DOCUMENT ME!
      GeneralSecurityException
    • validatePassword

      protected boolean validatePassword(String originalPassword, String storedEncodedPassword) throws GeneralSecurityException, org.apache.commons.codec.DecoderException
      입력한 password 가 저장된 password 와 일치하는지 검증한다.

      저장된 값을 복호화한 후 iterations:salt:hash 형식에서 salt 와 반복 횟수를 구하고, 입력한 password 의 hash 를 계산하여 일정한 시간에 비교한다.

      Parameters:
      originalPassword - 입력한 plain text password
      storedEncodedPassword - 저장되어 있는 암호화된 password
      Returns:
      일치하면 true
      Throws:
      GeneralSecurityException - 복호화 또는 hash 계산 중 오류가 발생한 경우
      org.apache.commons.codec.DecoderException - salt 또는 hash 의 Hex 디코딩에 실패한 경우