Class DSMACipher


  • public class DSMACipher
    extends Object
    • Constructor Detail

      • DSMACipher

        public DSMACipher()
    • 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)