Пример #1
0
        private static PiiRedactor <string> GetRedactorForProxyAddress(ProxyAddressPrefix prefix)
        {
            PiiRedactor <string> result = null;

            if (prefix.PrimaryPrefix == ProxyAddressPrefix.LegacyDN.PrimaryPrefix || prefix.PrimaryPrefix == ProxyAddressPrefix.X500.PrimaryPrefix)
            {
                result = new PiiRedactor <string>(SuppressingPiiData.RedactLegacyDN);
            }
            else if (prefix.PrimaryPrefix == ProxyAddressPrefix.Notes.PrimaryPrefix || prefix.PrimaryPrefix == ProxyAddressPrefix.SIP.PrimaryPrefix || prefix is SmtpProxyAddressPrefix)
            {
                result = new PiiRedactor <string>(SuppressingPiiData.RedactSmtpAddress);
            }
            else if (prefix is X400ProxyAddressPrefix)
            {
                result = new PiiRedactor <string>(SuppressingPiiData.RedactX400Address);
            }
            else if (prefix is EumProxyAddressPrefix)
            {
                result = new PiiRedactor <string>(SuppressingPiiData.RedactEum);
            }
            else if (prefix.PrimaryPrefix == ProxyAddressPrefix.CcMail.PrimaryPrefix)
            {
                result = new PiiRedactor <string>(SuppressingPiiData.Redact);
            }
            else if (!(prefix.PrimaryPrefix == ProxyAddressPrefix.MsMail.PrimaryPrefix) && !(prefix.PrimaryPrefix == ProxyAddressPrefix.GroupWise.PrimaryPrefix) && !(prefix is MeumProxyAddressPrefix))
            {
                result = new PiiRedactor <string>(SuppressingPiiData.Redact);
            }
            return(result);
        }
Пример #2
0
        public static ProxyAddress Redact(ProxyAddress proxyAddr, out string raw, out string redacted)
        {
            raw      = null;
            redacted = null;
            if (proxyAddr == null)
            {
                return(proxyAddr);
            }
            ProxyAddressPrefix   prefix = proxyAddr.Prefix;
            PiiRedactor <string> redactorForProxyAddress = SuppressingPiiData.GetRedactorForProxyAddress(prefix);

            if (redactorForProxyAddress != null)
            {
                return(prefix.GetProxyAddress(redactorForProxyAddress(proxyAddr.AddressString, out raw, out redacted), proxyAddr.IsPrimaryAddress));
            }
            return(proxyAddr);
        }