protected static MessageDigest prepareMessageDigest ( final String principal , final String service ) throws NoSuchAlgorithmException { val md = MessageDigest . getInstance ( "SHA" ) ; if ( StringUtils . isNotBlank ( service ) ) { md . update ( service . getBytes ( StandardCharsets . UTF_8 ) ) ; md . update ( CONST_SEPARATOR ) ; } md . update ( principal . getBytes ( StandardCharsets . UTF_8 ) ) ; md . update ( CONST_SEPARATOR ) ; return md ; }
Prepare message digest message digest .