Package com.helger.as2lib.crypto
Class MIC
java.lang.Object
com.helger.as2lib.crypto.MIC
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<MIC>
The MIC (Message Integrity Check) value. Basically a hash value over the
message.
- Since:
- 4.4.0
- Author:
- Philip Helger
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
MIC
-
-
Method Details
-
micBytes
- Returns:
- The mutual MIC bytes. Handle with care. Never
null
.
-
getDigestAlgorithm
- Returns:
- The algorithm that was used to create the MIC. Never
null
.
-
getAsAS2String
- Returns:
- This is the Base64-encoded message digest of the specified
algorithm. The exact layout must be
<Base64EncodedMIC>, <MICAlgorithmID>
-
getClone
- Specified by:
getClone
in interfacecom.helger.commons.lang.ICloneable<MIC>
-
equals
-
hashCode
public int hashCode() -
toString
-
parse
Parse the provided String representation of the MIC into aMIC
object. This is the reverse operation togetAsAS2String()
.- Parameters:
sMIC
- The MIC string to parse. May benull
.- Returns:
null
if an empty string was provided.- Throws:
IllegalArgumentException
- If the layout is invalid and either the bytes could not be Base64 decoded or if an invalid signing crypto algorithm was used.
-