Package de.gematik.rbellogger.util
Class CryptoUtils
- java.lang.Object
-
- de.gematik.rbellogger.util.CryptoUtils
-
public class CryptoUtils extends java.lang.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 java.util.Optional<byte[]>decrypt(byte[] encMessage, java.security.Key secretKey)static java.util.Optional<byte[]>decrypt(byte[] encMessage, java.security.Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes)static byte[]ecka(java.security.PrivateKey prk, java.security.PublicKey puk)static byte[]hkdf(byte[] ikm, byte[] info, int lengthInBytes)static byte[]hkdf(byte[] ikm, java.lang.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(java.security.PrivateKey prk, java.security.PublicKey puk) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionjava.security.InvalidKeyException
-
hkdf
public static byte[] hkdf(byte[] ikm, java.lang.String info, int lengthInBytes) throws java.lang.IllegalArgumentException, org.bouncycastle.crypto.DataLengthException- Throws:
java.lang.IllegalArgumentExceptionorg.bouncycastle.crypto.DataLengthException
-
hkdf
public static byte[] hkdf(byte[] ikm, byte[] info, int lengthInBytes) throws java.lang.IllegalArgumentException, org.bouncycastle.crypto.DataLengthException- Throws:
java.lang.IllegalArgumentExceptionorg.bouncycastle.crypto.DataLengthException
-
decrypt
public static java.util.Optional<byte[]> decrypt(byte[] encMessage, java.security.Key secretKey)
-
decrypt
public static java.util.Optional<byte[]> decrypt(byte[] encMessage, java.security.Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes)
-
-