Package de.gematik.rbellogger.util
Class CryptoUtils
java.lang.Object
de.gematik.rbellogger.util.CryptoUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<byte[]>static Optional<byte[]>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[]
-
Field Details
-
GCM_IV_LENGTH_IN_BYTES
public static final int GCM_IV_LENGTH_IN_BYTES- See Also:
-
GCM_TAG_LENGTH_IN_BYTES
public static final int GCM_TAG_LENGTH_IN_BYTES- See Also:
-
-
Method Details
-
ecka
public static byte[] ecka(PrivateKey prk, PublicKey puk) throws NoSuchAlgorithmException, 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
-
decrypt
-
decryptUnsafe
public static byte[] decryptUnsafe(byte[] encMessage, Key secretKey, int gcmIvLengthInBytes, int gcmTagLengthInBytes) throws GeneralSecurityException - Throws:
GeneralSecurityException
-