Class AESGCM
- java.lang.Object
-
- de.gematik.ti.vauchannel.protocol.helpers.AESGCM
-
public class AESGCM extends java.lang.Object- Author:
- matthias.unverzagt
-
-
Field Summary
Fields Modifier and Type Field Description static intAES_KEY_SIZEstatic intGCM_IV_LENGTHstatic intGCM_TAG_LENGTH
-
Constructor Summary
Constructors Constructor Description AESGCM()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]decrypt(byte[] encMessage, byte[] key)static byte[]decrypt(byte[] encMessage, byte[] key, byte[] associatedData)static byte[]encrypt(byte[] input, byte[] key)static byte[]encrypt(byte[] input, byte[] key, byte[] associatedData)static byte[]encrypt(byte[] input, byte[] key, byte[] associatedData, long counter)static byte[]encrypt(byte[] input, byte[] key, long counter)static org.bouncycastle.crypto.io.CipherOutputStreamencrypt(java.io.OutputStream os, byte[] key)static byte[]generateIV()static byte[]generateIV(long counter)static javax.crypto.SecretKeygenerateSymmetricKey()static javax.crypto.SecretKeykeyFromBytes(byte[] encodedKey)static byte[]longToBytes(long x)
-
-
-
Field Detail
-
AES_KEY_SIZE
public static final int AES_KEY_SIZE
- See Also:
- Constant Field Values
-
GCM_IV_LENGTH
public static final int GCM_IV_LENGTH
- See Also:
- Constant Field Values
-
GCM_TAG_LENGTH
public static final int GCM_TAG_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
encrypt
public static byte[] encrypt(byte[] input, byte[] key, long counter) throws java.lang.Exception- Throws:
java.lang.Exception
-
encrypt
public static byte[] encrypt(byte[] input, byte[] key) throws java.lang.Exception- Throws:
java.lang.Exception
-
encrypt
public static byte[] encrypt(byte[] input, byte[] key, byte[] associatedData) throws java.lang.Exception- Throws:
java.lang.Exception
-
encrypt
public static byte[] encrypt(byte[] input, byte[] key, byte[] associatedData, long counter) throws java.lang.Exception- Throws:
java.lang.Exception
-
decrypt
public static byte[] decrypt(byte[] encMessage, byte[] key) throws java.lang.Exception- Throws:
java.lang.Exception
-
decrypt
public static byte[] decrypt(byte[] encMessage, byte[] key, byte[] associatedData) throws java.lang.Exception- Throws:
java.lang.Exception
-
generateIV
public static byte[] generateIV()
-
generateIV
public static byte[] generateIV(long counter)
-
longToBytes
public static byte[] longToBytes(long x)
-
keyFromBytes
public static javax.crypto.SecretKey keyFromBytes(byte[] encodedKey)
-
generateSymmetricKey
public static javax.crypto.SecretKey generateSymmetricKey()
-
encrypt
public static org.bouncycastle.crypto.io.CipherOutputStream encrypt(java.io.OutputStream os, byte[] key)
-
-