Class DSMACipher


  • public class DSMACipher
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DSMACipher()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void attachGCMTag​(java.io.ByteArrayOutputStream cipherStream, com.fortanix.sdkms.v1.model.CryptMode mode, byte[] gcmTag, int expectedTagLength)
      Prefix gcm tag to cipher text
      static byte[] decrypt​(java.lang.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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DSMACipher

        public DSMACipher()
    • Method Detail

      • attachGCMTag

        public static void attachGCMTag​(java.io.ByteArrayOutputStream cipherStream,
                                        com.fortanix.sdkms.v1.model.CryptMode mode,
                                        byte[] gcmTag,
                                        int expectedTagLength)
                                 throws java.io.IOException
        Prefix gcm tag to cipher text
        Parameters:
        cipherStream -
        mode -
        gcmTag -
        expectedTagLength - gcmTag.length should match to this
        Throws:
        java.io.IOException
      • encrypt

        public static byte[] encrypt​(com.fortanix.sdkms.v1.model.EncryptRequestEx encryptRequest)
      • decrypt

        public static byte[] decrypt​(java.lang.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)