Package de.xima.fc.security.encryption
Class DBEncryptionProvider
- java.lang.Object
-
- de.xima.fc.security.encryption.DBEncryptionProvider
-
public final class DBEncryptionProvider extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static IDBEncryptionProcessor
PROCCESSOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EEncryptionTestResult
checkEncryption(DataSource datasource, String encryptionPassword, EDBEncryptionAlgorithm encryptionAlgorithm)
static EFcEncryptionScope
getEncryptionScope(javax.persistence.EntityManagerFactory factory, javax.persistence.metamodel.EntityType<?> entityType, javax.persistence.metamodel.Attribute<?,?> attribute)
Checks if the given attribute is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType.static EFcEncryptionScope
getEncryptionScope(javax.persistence.EntityManagerFactory factory, org.hibernate.type.Type type)
Checks if the given type is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType.static void
initialize(IDBEncryptionProcessor processor)
static boolean
isConfigurationValid()
static boolean
isEncryptedAttribute(javax.persistence.EntityManagerFactory factory, javax.persistence.metamodel.EntityType<?> entityType, javax.persistence.metamodel.Attribute<?,?> attribute)
Checks if the given attribute is an encrypted attribute, such as FCEncryptedStringType or FormDataEncryptedBinaryType.static boolean
isEncryptedType(javax.persistence.EntityManagerFactory factory, org.hibernate.type.Type type)
Checks if the given type is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType.static boolean
isMigrationRunning()
static void
migrate(EDBEncryptionAlgorithm newAlgorithm, String newPassword)
-
-
-
Field Detail
-
PROCCESSOR
public static IDBEncryptionProcessor PROCCESSOR
-
-
Method Detail
-
initialize
public static void initialize(IDBEncryptionProcessor processor)
-
migrate
public static void migrate(EDBEncryptionAlgorithm newAlgorithm, String newPassword)
-
checkEncryption
public static EEncryptionTestResult checkEncryption(DataSource datasource, String encryptionPassword, EDBEncryptionAlgorithm encryptionAlgorithm) throws SQLException
- Throws:
SQLException
-
isConfigurationValid
public static boolean isConfigurationValid()
-
isMigrationRunning
public static boolean isMigrationRunning()
-
getEncryptionScope
public static EFcEncryptionScope getEncryptionScope(javax.persistence.EntityManagerFactory factory, org.hibernate.type.Type type)
Checks if the given type is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType. If it is, returns theencryption scope
of that type.- Parameters:
factory
- The Hibernate session factory.type
- The type to check.- Returns:
- The encryption scope of the given type, or
null
if the type is not an encrypted type.
-
getEncryptionScope
public static EFcEncryptionScope getEncryptionScope(javax.persistence.EntityManagerFactory factory, javax.persistence.metamodel.EntityType<?> entityType, javax.persistence.metamodel.Attribute<?,?> attribute)
Checks if the given attribute is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType. If it is, returns theencryption scope
of that type.- Parameters:
factory
- The Hibernate session factory.entityType
- The entity type owning the attribute.attribute
- The attribute to check.- Returns:
- The encryption scope of the given type, or
null
if the type is not an encrypted type.
-
isEncryptedAttribute
public static boolean isEncryptedAttribute(javax.persistence.EntityManagerFactory factory, javax.persistence.metamodel.EntityType<?> entityType, javax.persistence.metamodel.Attribute<?,?> attribute)
Checks if the given attribute is an encrypted attribute, such as FCEncryptedStringType or FormDataEncryptedBinaryType.- Parameters:
factory
- The Hibernate session factory.entityType
- The entity type owning the attribute.attribute
- The attribute to check.- Returns:
true
if the given attribute is an encrypted attribute,false
otherwise.
-
isEncryptedType
public static boolean isEncryptedType(javax.persistence.EntityManagerFactory factory, org.hibernate.type.Type type)
Checks if the given type is an encrypted type, such as FCEncryptedStringType or FormDataEncryptedBinaryType.- Parameters:
factory
- The Hibernate session factory.type
- The type to check.- Returns:
true
if the given type is an encrypted type,false
otherwise.
-
-