| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_SHA_1); |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SHA_1; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] digestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SHA_1); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | byte[] userPWDigestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SHA_1); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-1 should be considered secure. |
| | | return true; |
| | | } |