Class DSMACipher
- java.lang.Object
-
- com.fortanix.sdkms.jce.provider.ciphers.DSMACipher
-
public class DSMACipher extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DSMACipher.CipherAndTag
-
Constructor Summary
Constructors Constructor Description DSMACipher()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
attachGCMTag(ByteArrayOutputStream cipherStream, com.fortanix.sdkms.v1.model.CryptMode mode, byte[] gcmTag, int expectedTagLength)
Prefix gcm tag to cipher textstatic byte[]
decrypt(Integer tagLength, com.fortanix.sdkms.v1.model.DecryptRequestEx decryptRequest)
static byte[]
encrypt(com.fortanix.sdkms.v1.model.EncryptRequestEx encryptRequest)
static DSMACipher.CipherAndTag
extractGCMTag(int tagLength, byte[] cipherTagBytes, int cipherTagOffset, int cipherTagLen)
static boolean
isGCM(com.fortanix.sdkms.v1.model.CryptMode mode)
-
-
-
Method Detail
-
attachGCMTag
public static void attachGCMTag(ByteArrayOutputStream cipherStream, com.fortanix.sdkms.v1.model.CryptMode mode, byte[] gcmTag, int expectedTagLength) throws IOException
Prefix gcm tag to cipher text- Parameters:
cipherStream
-mode
-gcmTag
-expectedTagLength
- gcmTag.length should match to this- Throws:
IOException
-
encrypt
public static byte[] encrypt(com.fortanix.sdkms.v1.model.EncryptRequestEx encryptRequest)
-
decrypt
public static byte[] decrypt(Integer tagLength, com.fortanix.sdkms.v1.model.DecryptRequestEx decryptRequest)
-
isGCM
public static boolean isGCM(com.fortanix.sdkms.v1.model.CryptMode mode)
-
extractGCMTag
public static DSMACipher.CipherAndTag extractGCMTag(int tagLength, byte[] cipherTagBytes, int cipherTagOffset, int cipherTagLen)
-
-