Skip to content

Commit

Permalink
add method documentaion
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamCS03 committed Mar 23, 2023
1 parent 01c1c45 commit c4c5ed3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions store/src/java/com/zimbra/cs/mailbox/MailSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -1480,13 +1480,26 @@ public static void unregisterPreSendMailListener(PreSendMailListener listener) {
}
}

/**
* provide the Hash for Message-Verification header field.
* @param id
* @param date
* @param from
* @throws ServiceException
*/
public static String getHashForMessageVerification(String id, Date date, String from) throws MessagingException, ServiceException {
String guid = (id + date + from);
String guidHash = getEncryptedValue(guid, ALGORITHM_NAME);
String hash = HASH_ALGORITHM_INFO + guidHash;
return hash;
}

/**
* provide the Encrypted value of the GUID.
* @param input
* @param algo
* @throws ServiceException
*/
public static String getEncryptedValue(String input, String algo) throws ServiceException {
try {
MessageDigest md1 = MessageDigest.getInstance(algo);
Expand Down

0 comments on commit c4c5ed3

Please sign in to comment.