public final class ConnectorCryptoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTORCRYPTO_ALGO_NAME_KEY
Property to change the default algoritm used to generate a key.
|
static String |
CONNECTORCRYPTO_KEYSIZE_KEY
Property to change the default keysize used to generate a key.
|
static String |
CONNECTORCRYPTO_MOCK_KEY
Property to allow the use of a static key when generating a symmetric key.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
calculateDigest(String digestAlgo,
byte[] content)
Helper method to calculate a Digest
|
static byte[] |
decrypt(Key key,
byte[] encryptedBytes)
Decrypt the encryptedBytes bases on the key.
|
static byte[] |
decrypt(Key key,
String algo,
byte[] encryptedBytes)
Decrypt the encryptedBytes bases on the key and the given algoritm.
|
static SecretKey |
generateKey()
Generate a key based using th default algoritm and keysize.
|
static SecretKey |
generateKey(int keySize)
Generate a key based on the default algoritm and the keysize given as input.
|
static SecretKey |
generateKey(String algo,
int keySize)
Generate a key based on the algoritm and keysize given as input.
|
static void |
setKeyGenerator(KeyGenerator keyGenerator)
Setting the KeyGenerator to use for generating a SecretKey
|
public static final String CONNECTORCRYPTO_ALGO_NAME_KEY
public static final String CONNECTORCRYPTO_KEYSIZE_KEY
public static final String CONNECTORCRYPTO_MOCK_KEY
public static SecretKey generateKey() throws TechnicalConnectorException
TechnicalConnectorException
public static SecretKey generateKey(int keySize) throws TechnicalConnectorException
TechnicalConnectorException
public static SecretKey generateKey(String algo, int keySize) throws TechnicalConnectorException
TechnicalConnectorException
public static byte[] decrypt(Key key, byte[] encryptedBytes) throws TechnicalConnectorException
TechnicalConnectorException
public static byte[] decrypt(Key key, String algo, byte[] encryptedBytes) throws TechnicalConnectorException
TechnicalConnectorException
public static void setKeyGenerator(KeyGenerator keyGenerator)
keyGenerator
- public static byte[] calculateDigest(String digestAlgo, byte[] content) throws TechnicalConnectorException
TechnicalConnectorException
Connector Packaging TECHNICAL 4.4.0 API
Copyright © {inceptionYear}-2023 eHealth. All Rights Reserved.