Package com.easydesk.attribute
Class PasswordAttribute
java.lang.Object
com.easydesk.om.BaseAttributeValue
com.easydesk.om.AttributeValue
com.easydesk.attribute.FreeFormAttribute
com.easydesk.attribute.StringAttribute
com.easydesk.attribute.PasswordAttribute
- All Implemented Interfaces:
Viewable,Cacheable,Observed,Retrievable,Serializable,ColumnAccessByName,ObjectModel,Persistent
DOCUMENT ME!
- Version:
- $id: PasswordAttribute.java $Revision$, 02-25-22 7:05:54 PM KST
- Author:
- YounghoCho
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.easydesk.om.AttributeValue
AttributeValue.AccessEnum -
Field Summary
Fields inherited from class com.easydesk.om.AttributeValue
activitySet, chainedFields inherited from interface com.easydesk.validator.Retrievable
KEY_SEPERATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgenerateStorngPasswordHash(String password) DOCUMENT ME!voidsetPassword(String plain) plain text password 를 encryptPassword 로 변경 저장한다.protected booleanvalidatePassword(String originalPassword, String storedEncodedPassword) 입력한 password 가 저장된 password 와 일치하는지 검증한다.Methods inherited from class com.easydesk.attribute.StringAttribute
getLocalizedValue, getLocalizedValue, hasValueMethods inherited from class com.easydesk.attribute.FreeFormAttribute
getDisplayedValue, getDisplayedValue, getFormatter, init, loadResources, setResourcesMethods inherited from class com.easydesk.om.AttributeValue
alwaysNeedActivity, clear, copy, copy, endActivitySet, getActivity, getActivityDescription, getAttachment, getChainedValue, getChainedValue, getChainedValue, getInputValue, getLocalizedValue, getLocalizedValue, getLocalizedValue, getLocalizedValues, getLocalizedValues, getMethodCache, getModuleAttribute, getNewInstance, getNewInstance, getNumericValues, getNumericValues, getNumericValuesAsString, getNumericValuesAsString, getObserverOption, getOptionIdAsString, getOptionIds, getOptionIds, getOptionIdsAsString, getOptionIdsAsString, getOptionValues, getPossibleTransitionCount, getPossibleTransitionCount, getPrimitiveOptionIds, getPrimitiveUserIds, getQueryKey, getRelativePath, getRelativePath, getRepository, getResource, getTransactionId, getUser, getUserIds, getValueList, getValueList, getValues, getValues, getValuesAsString, getValuesAsString, hasAlreadyChained, isModified, isQuickSearchAttribute, isSet, isSetOnly, needActivity, performAfter, performBefore, register, save, setActivity, setActivityDescription, setAttachment, setChainedValue, setInputValue, setNumericValue, setNumericValueOnly, setNumericValues, setOptionId, setOptionIdOnly, setOptionIds, setOptionValues, setPrimitiveOptionIds, setPrimitiveUserIds, setProperties, setTransactionId, setUser, setUserId, setUserIdOnly, setUserIds, setValue, setValueOnly, setValues, startActivitySet, toStringMethods inherited from class com.easydesk.om.BaseAttributeValue
copy, copy, copyInto, copyInto, copyInto, copyInto, equals, getAttribute, getAttribute, getAttributeId, getAttributeOption, getAttributeOption, getByName, getByPeerName, getByPosition, getDepend, getDepend, getDependId, getEasyDeskUserImpl, getEasyDeskUserImpl, getFieldNames, getForeignKeyForAttribute, getForeignKeyForAttributeOption, getForeignKeyForDepend, getForeignKeyForEasyDeskUserImpl, getForeignKeyForItem, getItem, getItem, getItemId, getNumericValue, getOptionId, getPeer, getPrimaryKey, getTableMap, getUserId, getValue, getValueId, hashCode, isCacheOnSave, isDeleted, isLoading, isModified, isNew, isRemoved, isSaving, resetModified, save, save, setAttribute, setAttributeId, setAttributeKey, setAttributeOption, setAttributeOptionKey, setByName, setByPeerName, setByPosition, setDeleted, setDepend, setDependId, setDependKey, setEasyDeskUserImpl, setEasyDeskUserImplKey, setItem, setItemId, setItemKey, setLoading, setModified, setNew, setPrimaryKey, setPrimaryKey, setRemoved, setSaving, setValueId, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.easydesk.attribute.Viewable
getComponentName
-
Constructor Details
-
PasswordAttribute
public PasswordAttribute()새로운PasswordAttribute인스턴스를 생성한다.
-
-
Method Details
-
setPassword
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 passwordstoredEncodedPassword- 저장되어 있는 암호화된 password- Returns:
- 일치하면
true - Throws:
GeneralSecurityException- 복호화 또는 hash 계산 중 오류가 발생한 경우org.apache.commons.codec.DecoderException- salt 또는 hash 의 Hex 디코딩에 실패한 경우
-