Package de.gematik.rbellogger.util
Class CryptoUtils
- java.lang.Object
-
- de.gematik.rbellogger.util.CryptoUtils
-
public class CryptoUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intGCM_IV_LENGTH_IN_BYTESstatic intGCM_TAG_LENGTH_IN_BYTES
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<byte[]>decrypt(byte[] encMessage, Key secretKey)static Optional<byte[]>decrypt(byte[] encMessage, Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes)static byte[]decryptUnsafe(byte[] encMessage, Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes)static byte[]ecka(PrivateKey prk, PublicKey puk)static byte[]hkdf(byte[] ikm, byte[] info, int lengthInBytes)static byte[]hkdf(byte[] ikm, String info, int lengthInBytes)
-
-
-
Field Detail
-
GCM_IV_LENGTH_IN_BYTES
public static final int GCM_IV_LENGTH_IN_BYTES
- See Also:
- Constant Field Values
-
GCM_TAG_LENGTH_IN_BYTES
public static final int GCM_TAG_LENGTH_IN_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
ecka
public static byte[] ecka(PrivateKey prk, PublicKey puk) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException
-
hkdf
public static byte[] hkdf(byte[] ikm, String info, int lengthInBytes) throws IllegalArgumentException, org.bouncycastle.crypto.DataLengthException- Throws:
IllegalArgumentExceptionorg.bouncycastle.crypto.DataLengthException
-
hkdf
public static byte[] hkdf(byte[] ikm, byte[] info, int lengthInBytes) throws IllegalArgumentException, org.bouncycastle.crypto.DataLengthException- Throws:
IllegalArgumentExceptionorg.bouncycastle.crypto.DataLengthException
-
decrypt
public static Optional<byte[]> decrypt(byte[] encMessage, Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes)
-
decryptUnsafe
public static byte[] decryptUnsafe(byte[] encMessage, Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes) throws GeneralSecurityException- Throws:
GeneralSecurityException
-
-