Class PrometheusEncryptor
java.lang.Object
io.github.tonywasher.joceanus.prometheus.data.PrometheusEncryptor
Encryptor/Decryptor.
-
Constructor Summary
ConstructorsConstructorDescriptionPrometheusEncryptor(OceanusDataFormatter pFormatter, GordianKeySet pKeySet) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadoptEncryption(PrometheusEncryptedPair pTarget, PrometheusEncryptedPair pSource) Adopt Encryption.(package private) PrometheusEncryptedPairdecryptValue(byte[] pBytes, MetisFieldItem.MetisFieldDef pField) Decrypt bytes.(package private) PrometheusEncryptedPairdecryptValue(byte[] pBytes, Class<?> pClazz) Decrypt bytes.encryptValue(PrometheusEncryptedPair pCurrent, Object pValue) Encrypt a value.byte[]encryptValue(Object pValue) Encrypt a value.encryptValue(Object pValue, MetisFieldItem.MetisFieldDef pField) Encrypt a value.(package private) static MetisDataTypegetDataTypeForClass(Class<?> pClazz) Determine dataType.static MetisDataTypegetDataTypeForValue(Object pValue) Determine dataType.Obtain the keySet.
-
Constructor Details
-
PrometheusEncryptor
Constructor.- Parameters:
pFormatter- the formatterpKeySet- the keySet
-
-
Method Details
-
getKeySet
Obtain the keySet.- Returns:
- the keySet
-
encryptValue
Encrypt a value.- Parameters:
pValue- the value to encrypt.- Returns:
- the encryptedBytes
- Throws:
OceanusException- on error
-
encryptValue
public PrometheusEncryptedPair encryptValue(PrometheusEncryptedPair pCurrent, Object pValue) throws OceanusException Encrypt a value.- Parameters:
pCurrent- the current valuepValue- the value to encrypt.- Returns:
- the encryptedPair.
- Throws:
OceanusException- on error
-
encryptValue
public PrometheusEncryptedPair encryptValue(Object pValue, MetisFieldItem.MetisFieldDef pField) throws OceanusException Encrypt a value.- Parameters:
pValue- the value to encrypt.pField- the field definition- Returns:
- the encryptedPair.
- Throws:
OceanusException- on error
-
decryptValue
PrometheusEncryptedPair decryptValue(byte[] pBytes, MetisFieldItem.MetisFieldDef pField) throws OceanusException Decrypt bytes.- Parameters:
pBytes- the bytes to decrypt.pField- the field definition- Returns:
- the encryptedPair.
- Throws:
OceanusException- on error
-
decryptValue
Decrypt bytes.- Parameters:
pBytes- the bytes to decrypt.pClazz- the class to decrypt to- Returns:
- the encryptedPair.
- Throws:
OceanusException- on error
-
getDataTypeForValue
Determine dataType.- Parameters:
pValue- the value- Returns:
- the dataType
- Throws:
OceanusException- on error
-
getDataTypeForClass
Determine dataType.- Parameters:
pClazz- the class- Returns:
- the dataType
- Throws:
OceanusException- on error
-
adoptEncryption
public void adoptEncryption(PrometheusEncryptedPair pTarget, PrometheusEncryptedPair pSource) throws OceanusException Adopt Encryption.- Parameters:
pTarget- the target fieldpSource- the source field- Throws:
OceanusException- on error
-