Class NativeCipherSpi


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

      Constructors 
      Constructor Description
      NativeCipherSpi()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void nativeClose​(int nativeTransformationId, int nativeId)  
      static int nativeDecrypt​(int nativeTransformationId, int nativeId, byte[] buffer, int i, int len, byte[] output, int outputOffset, boolean doFinal)  
      static int nativeEncrypt​(int nativeTransformationId, int nativeId, byte[] buffer, int i, int len, byte[] output, int outputOffset, boolean doFinal)  
      static int nativeGetBufferedLength​(int nativeTransformationId, int nativeId)  
      static int nativeGetCloseId​(int nativeTransformationId)
      Gets the id of the native close function.
      static void nativeGetIV​(int nativeTransformationId, int nativeId, byte[] iv, int ivLength)  
      static int nativeGetIVLength​(int nativeTransformationId, int nativeId)
      Return -1 if no IV, otherwise returns the length of the IV.
      static int nativeGetTransformationDescription​(byte[] transformationBytes, byte[] description)  
      static int nativeInit​(int nativeTransformationId, boolean decrypting, int nativeKeyId, byte[] ivBytes, int ivLength, int tagLength)
      Throw NativeException on error.
      static void nativeSetIV​(int nativeTransformationId, int nativeId, byte[] iv, int ivLength)  
      static void nativeUpdateAAD​(int nativeTransformationId, int nativeId, byte[] src, int offset, int len)  
      • Methods inherited from class java.lang.Object

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

      • NativeCipherSpi

        public NativeCipherSpi()
    • Method Detail

      • nativeGetTransformationDescription

        public static int nativeGetTransformationDescription​(byte[] transformationBytes,
                                                             byte[] description)
      • nativeGetBufferedLength

        public static int nativeGetBufferedLength​(int nativeTransformationId,
                                                  int nativeId)
      • nativeGetIV

        public static void nativeGetIV​(int nativeTransformationId,
                                       int nativeId,
                                       byte[] iv,
                                       int ivLength)
      • nativeSetIV

        public static void nativeSetIV​(int nativeTransformationId,
                                       int nativeId,
                                       byte[] iv,
                                       int ivLength)
      • nativeUpdateAAD

        public static void nativeUpdateAAD​(int nativeTransformationId,
                                           int nativeId,
                                           byte[] src,
                                           int offset,
                                           int len)
      • nativeGetIVLength

        public static int nativeGetIVLength​(int nativeTransformationId,
                                            int nativeId)
        Return -1 if no IV, otherwise returns the length of the IV.
      • nativeInit

        public static int nativeInit​(int nativeTransformationId,
                                     boolean decrypting,
                                     int nativeKeyId,
                                     byte[] ivBytes,
                                     int ivLength,
                                     int tagLength)
                              throws ej.sni.NativeException
        Throw NativeException on error. Returns a nativeId.
        Throws:
        ej.sni.NativeException
      • nativeDecrypt

        public static int nativeDecrypt​(int nativeTransformationId,
                                        int nativeId,
                                        byte[] buffer,
                                        int i,
                                        int len,
                                        byte[] output,
                                        int outputOffset,
                                        boolean doFinal)
                                 throws ej.sni.NativeException
        Throws:
        ej.sni.NativeException
      • nativeEncrypt

        public static int nativeEncrypt​(int nativeTransformationId,
                                        int nativeId,
                                        byte[] buffer,
                                        int i,
                                        int len,
                                        byte[] output,
                                        int outputOffset,
                                        boolean doFinal)
                                 throws ej.sni.NativeException
        Throws:
        ej.sni.NativeException
      • nativeClose

        public static void nativeClose​(int nativeTransformationId,
                                       int nativeId)
                                throws ej.sni.NativeException
        Throws:
        ej.sni.NativeException
      • nativeGetCloseId

        public static int nativeGetCloseId​(int nativeTransformationId)
                                    throws ej.sni.NativeException
        Gets the id of the native close function.
        Parameters:
        nativeTransformationId - ID of the transformation
        Returns:
        the id of the static native close function
        Throws:
        ej.sni.NativeException