MCPcopy Create free account
hub / github.com/M66B/FairEmail / getDigest

Method getDigest

app/src/main/java/com/sun/mail/pop3/Protocol.java:407–419  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

loginMethod · 0.95

Calls 4

toHexMethod · 0.95
digestMethod · 0.65
getInstanceMethod · 0.45
getBytesMethod · 0.45

Tested by

no test coverage detected