rehydrate()
Replaces PII placeholders with original values.Signature
Parameters
Text containing PII placeholder tags
Decrypted PII map from
decryptPIIMap()If
true, use strict matching (exact tag format only). If false, use fuzzy matching that handles mangled tags from translation.Tag format configuration. Must match the format used during anonymization. Defaults to XML-style (
<PII type="..." id="N"/>).Returns
Text with placeholders replaced by original values.Example
decryptPIIMap()
Decrypts the encrypted PII map from an anonymization result.Signature
Parameters
The encrypted PII map from
result.piiMapThe encryption key (same key used during anonymization)
Returns
AMap<string, string> where:
- Key:
"TYPE:id"(e.g.,"EMAIL:1","PERSON:2") - Value: Original PII value
Example
Complete Workflow
Session-Based Rehydration
When using sessions, rehydration is simplified:Placeholder Format
By default, rehydrate expects placeholders in XML-style format:tagFormat used during anonymization:
type and id attributes.
Handling Malformed Placeholders
Error Handling
Missing Key
Missing PII Entry
Related
- Encryption - How PII maps are encrypted
- Sessions - Simplified rehydration with sessions
- Crypto - Key management utilities