Class AnonymizationService
Namespace: Casewhere.Gdpr.Runtime
Assembly: Casewhere.Gdpr.Runtime.dll
Provides the functionality to perform data anonymization.
public class AnonymizationService : IAnonymizationService
Inheritance
Implements
Inherited Members
object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()
Extension Methods
ObjectExtension.ConvertToBsonValue(object), EnumExtensions.DeepClone<AnonymizationService>(AnonymizationService)
Constructors
AnonymizationService(IRuleEvaluator, IDataAttributeConverter, IDOFactoryValidator, IDataProtector, IDataObjectRepository)
Initializes a new instance of the Casewhere.Gdpr.Runtime.AnonymizationService class.
public AnonymizationService(IRuleEvaluator ruleEvaluator, IDataAttributeConverter dataAttributeConverter, IDOFactoryValidator doValidator, IDataProtector dataProtector, IDataObjectRepository dataObjectRepository)
Parameters
ruleEvaluator IRuleEvaluator
The rule evaluator.
dataAttributeConverter IDataAttributeConverter
The data attribute converter.
doValidator IDOFactoryValidator
The data object factory validator.
dataProtector IDataProtector
The data protector.
dataObjectRepository IDataObjectRepository
The data object repository.
Methods
AnonymizeActualData(AnonymizationTask, IList<PIIDataProtectionRuleWithDataClass>, DOId, IDictionary<string, object>)
Anonymizes the actual data using the specified protection rules and anonymization task.
public IDictionary<string, object> AnonymizeActualData(AnonymizationTask task, IList<PIIDataProtectionRuleWithDataClass> protectionRules, DOId doId, IDictionary<string, object> actualData)
Parameters
task AnonymizationTask
The anonymization task.
protectionRules IList<PIIDataProtectionRuleWithDataClass>
The collection of protection rules.
doId DOId
The ID of the data object.
actualData IDictionary<string, object>
The actual data.
Returns
The anonymized data.
AnonymizeValue(PIIDataProtectionRuleWithDataClass, IDictionary<string, object>)
Anonymizes the value using the specified protection rule and rule parameters.
public object AnonymizeValue(PIIDataProtectionRuleWithDataClass protectionRule, IDictionary<string, object> ruleParameters)
Parameters
protectionRule PIIDataProtectionRuleWithDataClass
The protection rule.
ruleParameters IDictionary<string, object>
The rule parameters.
Returns
The anonymized value.
BuildRuleParameters(AnonymizationTask, object, object)
Builds the rule parameters for the anonymization task.
public IDictionary<string, object> BuildRuleParameters(AnonymizationTask task, object originalAttributeValue, object originalDataObject)
Parameters
task AnonymizationTask
The anonymization task.
originalAttributeValue object
The original attribute value.
originalDataObject object
The original data object.
Returns
The dictionary of rule parameters.
FindProtectionRule(IEnumerable<PIIDataProtectionRuleWithDataClass>, string, string)
Finds the protection rule for the specified data class and attribute name.
public PIIDataProtectionRuleWithDataClass FindProtectionRule(IEnumerable<PIIDataProtectionRuleWithDataClass> protectionRules, string dataClassName, string attributeName)
Parameters
protectionRules IEnumerable<PIIDataProtectionRuleWithDataClass>
The collection of protection rules.
dataClassName string
The name of the data class.
attributeName string
The name of the attribute.
Returns
PIIDataProtectionRuleWithDataClass
The protection rule if found; otherwise, null.
GetDataObject(IReadOnlyList<StringAttribute>, string, string)
Gets the data object with the specified encrypted attributes.
public DynamicDataObject GetDataObject(IReadOnlyList<StringAttribute> encryptedAttributes, string dataClassName, string doId)
Parameters
encryptedAttributes IReadOnlyList<StringAttribute>
The list of encrypted attributes.
dataClassName string
The name of the data class.
doId string
The ID of the data object.
Returns
DynamicDataObject
The data object.
UnprotectActualData(IReadOnlyList<StringAttribute>, dynamic)
Unprotects the actual data by decrypting the encrypted attributes.
public void UnprotectActualData(IReadOnlyList<StringAttribute> encryptedAttributes, dynamic actualDataObject)
Parameters
encryptedAttributes IReadOnlyList<StringAttribute>
The list of encrypted attributes.
actualDataObject dynamic
The actual data object.