| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_BASE64; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return ByteStringFactory.create(Base64.encode(plaintext.value())); |
| | | } |
| | | |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_BASE64); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | String userString = Base64.encode(plaintextPassword.value()); |
| | | String storedString = storedPassword.stringValue(); |
| | | return userString.equals(storedString); |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | try |
| | | { |
| | | return ByteStringFactory.create(Base64.decode( |
| | |
| | | @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; |
| | | } |
| | |
| | | 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() |
| | | { |
| | | |
| | | // Base64-encoded values may be easily decoded with no key or special |
| | | // knowledge. |
| | | return false; |