Class SignatureHeaderUtils
- java.lang.Object
-
- org.apache.cxf.rs.security.httpsignature.utils.SignatureHeaderUtils
-
public final class SignatureHeaderUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddDateHeader(Map<String,List<String>> messageHeaders, ZoneOffset zoneOffset)Add a date header at the current time using the ZoneOffset.static StringcreateDigestHeader(String messageBody, String digestAlgorithmName)Get a base64 encoded digest using the Algorithm specified, typically SHA-256static MessageDigestcreateMessageDigestWithAlgorithm(String algorithmName)Get a MessageDigest object based on the algorithm in the digest stringstatic StringcreateRequestTarget(URI uri)static voidinspectMessageHeaders(Map<String,List<String>> messageHeaders)static Map<String,String>mapHeaders(Map<String,List<String>> multivaluedMap)Maps a multimap to a normal map with comma-separated values in case of duplicate headers according to the draft-cavage guidelines
-
-
-
Method Detail
-
addDateHeader
public static void addDateHeader(Map<String,List<String>> messageHeaders, ZoneOffset zoneOffset)
Add a date header at the current time using the ZoneOffset. Date format is http
-
mapHeaders
public static Map<String,String> mapHeaders(Map<String,List<String>> multivaluedMap)
Maps a multimap to a normal map with comma-separated values in case of duplicate headers according to the draft-cavage guidelines- Parameters:
multivaluedMap- the multivalued map- Returns:
- A map with comma-separated values
-
createDigestHeader
public static String createDigestHeader(String messageBody, String digestAlgorithmName)
Get a base64 encoded digest using the Algorithm specified, typically SHA-256- Parameters:
messageBody- The body of the message to be used to create the DigestdigestAlgorithmName- The name of the algorithm used to create the digest, SHA-256 and SHA-512 are valid- Returns:
- A base64 encoded digest ready to be added as a header to the message
-
createMessageDigestWithAlgorithm
public static MessageDigest createMessageDigestWithAlgorithm(String algorithmName)
Get a MessageDigest object based on the algorithm in the digest string- Returns:
- a valid MessageDigest object
-
inspectMessageHeaders
public static void inspectMessageHeaders(Map<String,List<String>> messageHeaders)
-
-