Gets the APOP message digest. From RFC 1939: The 'digest' parameter is calculated by applying the MD5 algorithm [RFC1321] to a string consisting of the timestamp (including angle-brackets) followed by a shared secret. The 'digest' parameter itself is a 16-octet value which is sent in hexadecimal fo
(String password)
| 405 | * @return The APOP digest or an empty string if an error occurs. |
| 406 | */ |
| 407 | private String getDigest(String password) { |
| 408 | String key = apopChallenge + password; |
| 409 | byte[] digest; |
| 410 | try { |
| 411 | MessageDigest md = MessageDigest.getInstance("MD5"); |
| 412 | digest = md.digest(key.getBytes("iso-8859-1")); // XXX |
| 413 | } catch (NoSuchAlgorithmException nsae) { |
| 414 | return null; |
| 415 | } catch (UnsupportedEncodingException uee) { |
| 416 | return null; |
| 417 | } |
| 418 | return toHex(digest); |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * Abstract base class for POP3 authentication mechanism implementations. |
no test coverage detected