Package org.alfresco.encryption
Class MACUtils
java.lang.Object
org.alfresco.encryption.MACUtils
Provides support for generating and checking MACs (Message Authentication Codes) using Alfresco's
secret keys.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents the information to be fed into the MAC generator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateMAC
(String keyAlias, MACUtils.MACInput macInput) protected Mac
protected byte[]
longToByteArray
(long l) void
setKeyProvider
(KeyProvider keyProvider) void
setMacAlgorithm
(String macAlgorithm) boolean
validateMAC
(String keyAlias, byte[] expectedMAC, MACUtils.MACInput macInput) Compares the expectedMAC against the MAC generated from Assumes message has been decrypted
-
Constructor Details
-
MACUtils
public MACUtils()Default constructor for IOC
-
-
Method Details
-
setKeyProvider
-
setMacAlgorithm
-
getMac
- Throws:
Exception
-
longToByteArray
- Throws:
IOException
-
generateMAC
-
validateMAC
Compares the expectedMAC against the MAC generated from Assumes message has been decrypted- Parameters:
keyAlias
- StringexpectedMAC
- byte[]macInput
- MACInput- Returns:
- boolean
-