Package org.trustdeck.algorithms
Class SHA3Pseudonymizer
java.lang.Object
org.trustdeck.algorithms.Pseudonymizer
org.trustdeck.algorithms.SHA3Pseudonymizer
This class provides a pseudonymization by assigning sha3-hash-values as pseudonyms
- Author:
- Armin Müller
-
Field Summary
Fields inherited from class org.trustdeck.algorithms.Pseudonymizer
DEFAULT_NUMBER_OF_RETRIES, DEFAULT_PADDING_CHAR, DEFAULT_VALUE_LENGTH, DOMAIN_FULL, PSEUDONYMIZATION_FAILED -
Constructor Summary
ConstructorsConstructorDescriptionBasic constructor.SHA3Pseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName) A constructor that allows to set whether or not the created pseudonyms should be padded as well as the desired pseudonym value length and the character used for padding.SHA3Pseudonymizer(boolean paddingWanted, Algorithm algorithm) Basic constructor.SHA3Pseudonymizer(boolean paddingWanted, Domain domain) Basic constructor.SHA3Pseudonymizer(String domainName) Basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionpseudonymize(String identifier, String domainPrefix) Creates a sha3 hash pseudonym from the given identifier.Methods inherited from class org.trustdeck.algorithms.Pseudonymizer
addCheckDigit, addPadding, correctPseudonymLength, persist
-
Constructor Details
-
SHA3Pseudonymizer
public SHA3Pseudonymizer()Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.) -
SHA3Pseudonymizer
Basic constructor. Padding is turned off. (The pseudonym value length is automatically set to the default, as well as the padding character.)- Parameters:
domainName- the name of the domain to which the record belongs to
-
SHA3Pseudonymizer
public SHA3Pseudonymizer(boolean paddingWanted, int pseudonymValueLength, char paddingChar, String domainName) A constructor that allows to set whether or not the created pseudonyms should be padded as well as the desired pseudonym value length and the character used for padding.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthpseudonymValueLength- the desired length of the pseudonym valuepaddingChar- the character that should be useddomainName- the name of the domain to which the record belongs to
-
SHA3Pseudonymizer
Basic constructor. All necessary variables are directly retrieved from the domain object.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthdomain- the domain object
-
SHA3Pseudonymizer
Basic constructor. All necessary variables are directly retrieved from the algorithm object.- Parameters:
paddingWanted- whether or not the pseudonyms should be padded to a certain lengthalgorithm- the algorithm object
-
-
Method Details
-
pseudonymize
Creates a sha3 hash pseudonym from the given identifier.- Specified by:
pseudonymizein classPseudonymizer- Parameters:
identifier- the value to be pseudonymizeddomainPrefix- the prefix for the domain- Returns:
- a pseudonym in the form of domainPrefix-pseudonymValue (e.g. TST-a1cd75fe29c449248cabfae)
-