Rename 'keep confidential' to 'never unsecure'.
authorDean
Thu, 04 Aug 2016 06:46:44 -0700
changeset 1104e7ef441d14ac
parent 1103 1e3057446937
child 1105 a0ebffe2a93d
Rename 'keep confidential' to 'never unsecure'.
Remove the ability to encrypt an email after it has been received unsecurely.
CryptableMailItem.cs
PEPMessage.cs
Properties/Resources.Designer.cs
Properties/Resources.resx
Resources/ImageKeepConfidentialOff.png
Resources/ImageKeepConfidentialOn.png
Resources/ImageNeverUnsecureOff.png
Resources/ImageNeverUnsecureOn.png
UI/RibbonCustomizations.cs
UI/RibbonCustomizations.xml
pEpForOutlook.csproj
     1.1 --- a/CryptableMailItem.cs	Wed Aug 03 10:26:32 2016 +0200
     1.2 +++ b/CryptableMailItem.cs	Thu Aug 04 06:46:44 2016 -0700
     1.3 @@ -571,10 +571,10 @@
     1.4          }
     1.5  
     1.6          /// <summary>
     1.7 -        /// Gets or sets whether this cryptable mail item is marked to keep confidential (encrypted).
     1.8 +        /// Gets or sets whether this cryptable mail item is marked to never be unsecure (always encrypted).
     1.9          /// This information is stored as a MAPI property of the wrapped mail item.
    1.10          /// </summary>
    1.11 -        public bool KeepConfidential
    1.12 +        public bool NeverUnsecure
    1.13          {
    1.14              get
    1.15              {
    1.16 @@ -584,7 +584,7 @@
    1.17                  {
    1.18                      // Return status can be ignored here, using the auto default value is good enough
    1.19                      CryptableMailItem.GetInterpretedProperty(this.internalMailItem,
    1.20 -                                                             PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
    1.21 +                                                             PEPMessage.PR_X_PEP_NEVER_UNSECURE,
    1.22                                                               out propValue);
    1.23                  }
    1.24  
    1.25 @@ -596,11 +596,11 @@
    1.26                  {
    1.27                      // Return status can be ignored
    1.28                      CryptableMailItem.SetInterpretedProperty(this.internalMailItem,
    1.29 -                                                             PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
    1.30 +                                                             PEPMessage.PR_X_PEP_NEVER_UNSECURE,
    1.31                                                               value);
    1.32                  }
    1.33  
    1.34 -                this.RaisePropertyChangedEvent("KeepConfidential");
    1.35 +                this.RaisePropertyChangedEvent("NeverUnsecure");
    1.36              }
    1.37          }
    1.38  
    1.39 @@ -827,9 +827,9 @@
    1.40          /// If the mail item is not a special case, or the special case rating is undefined, the below logic is run.
    1.41          /// 
    1.42          /// Encrypted Store _____ Sent Folder
    1.43 -        ///  (untrusted)       |   |_ Encrypted Mail (No need to check for KeepConfidential)
    1.44 +        ///  (untrusted)       |   |_ Encrypted Mail (No need to check for NeverUnsecure)
    1.45          ///      -or-          |   |   |_ Mirror Exists
    1.46 -        /// KeepConfidential   |   |   |   |_ Stored Rating Exists (in Mirror)
    1.47 +        ///  NeverUnsecure     |   |   |   |_ Stored Rating Exists (in Mirror)
    1.48          ///                    |   |   |   |   • Set returned color rating to the stored rating in the mirror
    1.49          ///                    |   |   |   |
    1.50          ///                    |   |   |   |_ No Stored Rating Exists/Undefined (in mirror)
    1.51 @@ -842,18 +842,11 @@
    1.52          ///                    |   |       • Set returned color rating to the calculated OutgoingColorRating
    1.53          ///                    |   |
    1.54          ///                    |   |_ Unencrypted Mail
    1.55 -        ///                    |       |_ Keep Confidential
    1.56 -        ///                    |       |   • Find existing mirror or create mirror and copy unencrypted mail to it
    1.57 -        ///                    |       |   • Set stored color rating in the mirror to pEp_rating_trusted
    1.58 -        ///                    |       |   • Encrypt the mail and overwrite current mail item (not the mirror)
    1.59 -        ///                    |       |   • Set returned color rating to pEp_rating_trusted
    1.60 -        ///                    |       |
    1.61 -        ///                    |       |_ Not Keep Confidential
    1.62 -        ///                    |           • Set returned color rating to pEp_rating_unencrypted
    1.63 -        ///                    |           • Do not set or modify any previous stored color rating (needed for switching untrusted->trusted)
    1.64 +        ///                    |       • Set returned color rating to pEp_rating_unencrypted
    1.65 +        ///                    |       • Do not set or modify any previous stored color rating (needed for switching untrusted->trusted)
    1.66          ///                    |
    1.67          ///                    |_ Incoming
    1.68 -        ///                    |   |_ Encrypted Mail (No need to check for KeepConfidential)
    1.69 +        ///                    |   |_ Encrypted Mail (No need to check for NeverUnsecure)
    1.70          ///                    |   |   |_ Mirror Exists
    1.71          ///                    |   |   |   • Do a test-decrypt of the mail to see if the rating has changed
    1.72          ///                    |   |   |     Compare against the stored color rating in the mirror
    1.73 @@ -867,16 +860,9 @@
    1.74          ///                    |   |      • Set returned color rating to the decrypted rating
    1.75          ///                    |   |
    1.76          ///                    |   |_ Unencrypted Mail
    1.77 -        ///                    |       |_ Keep Confidential
    1.78 -        ///                    |       |   • Find existing mirror or create mirror and copy unencrypted mail to it
    1.79 -        ///                    |       |   • Set stored color rating in the mirror to pEp_rating_trusted
    1.80 -        ///                    |       |   • Encrypt the mail and overwrite current mail item (not the mirror)
    1.81 -        ///                    |       |   • Set returned color rating to pEp_rating_trusted
    1.82 -        ///                    |       |
    1.83 -        ///                    |       |_ Not Keep Confidential
    1.84 -        ///                    |           • Set returned color rating to pEp_rating_unencrypted
    1.85 -        ///                    |           • Do not set or modify any previous stored color rating (needed for switching untrusted->trusted)
    1.86 -        ///                    |           • Call Decrypt to process the message even though no decryption/mirror required
    1.87 +        ///                    |       • Set returned color rating to pEp_rating_unencrypted
    1.88 +        ///                    |       • Do not set or modify any previous stored color rating (needed for switching untrusted->trusted)
    1.89 +        ///                    |       • Call Decrypt to process the message even though no decryption/mirror required
    1.90          ///                    |
    1.91          ///                    |_ Outgoing
    1.92          ///                        • Set returned color rating to the calculated OutgoingColorRating
    1.93 @@ -916,7 +902,7 @@
    1.94          ///                        • No decryption/mirror required
    1.95          /// 
    1.96          /// Additional Notes:
    1.97 -        ///  • For untrusted stores or 'keep confidential' messages, the stored color rating is saved to the mirror
    1.98 +        ///  • For untrusted stores or NeverUnsecure messages, the stored color rating is saved to the mirror
    1.99          ///  • For trusted stores, the stored color rating is saved to the mail item itself
   1.100          ///  
   1.101          private _pEp_color ProcessAndGetColorRating()
   1.102 @@ -930,7 +916,6 @@
   1.103                  int sleepTime = 1000; // 1 second in milliseconds
   1.104                  int curWaitTime = 0;
   1.105                  int maxWaitTime = 60000; // 1 minute in milliseconds
   1.106 -                bool rslt;
   1.107                  bool isAlreadyBeingDecrypted = false;
   1.108                  bool isDraft;
   1.109                  bool specialCaseFound = false;
   1.110 @@ -1068,18 +1053,18 @@
   1.111                      // Convert to a PEPMessage for processing
   1.112                      sts = PEPMessage.Create(this.internalMailItem, out internalMessage);
   1.113  
   1.114 -                    // Encrypted (untrusted) store or KeepConfidential
   1.115 +                    // Encrypted (untrusted) store or NeverUnsecure
   1.116                      if (CryptableMailItem.GetIsInEncryptedStore(this.internalMailItem) ||
   1.117 -                        CryptableMailItem.GetIsKeepConfidential(this.internalMailItem))
   1.118 +                        CryptableMailItem.GetIsNeverUnsecure(this.internalMailItem))
   1.119                      {
   1.120 -                        Globals.LogVerbose("ProcessAndGetColorRating: In encrypted store or marked keep confidendial.");
   1.121 +                        Globals.LogVerbose("ProcessAndGetColorRating: In encrypted store or marked never unsecure.");
   1.122  
   1.123                          // Sent Folder
   1.124                          if (CryptableMailItem.GetIsInSentFolder(this.internalMailItem))
   1.125                          {
   1.126                              Globals.LogVerbose("ProcessAndGetColorRating: In sent folder.");
   1.127  
   1.128 -                            // Encrypted mail in an encrypted (untrusted store) or marked keep confidential
   1.129 +                            // Encrypted mail in an encrypted (untrusted store) or marked never unsecure
   1.130                              // This will use a mirror
   1.131                              if (PEPMessage.GetIsEncrypted(this.internalMailItem))
   1.132                              {
   1.133 @@ -1157,60 +1142,12 @@
   1.134                                      }
   1.135                                  }
   1.136                              }
   1.137 -                            // Unencrypted mail in an encrypted (untrusted store) or marked keep confidential
   1.138 +                            // Unencrypted mail in an encrypted (untrusted store) or marked never unsecure
   1.139 +                            // This does not have a mirror
   1.140                              else
   1.141                              {
   1.142 -                                // Marked keep confidential
   1.143 -                                // This will use a mirror
   1.144 -                                if (CryptableMailItem.GetIsKeepConfidential(this.internalMailItem))
   1.145 -                                {
   1.146 -                                    Globals.LogVerbose("ProcessAndGetColorRating: Is marked keep confidential.");
   1.147 -
   1.148 -                                    if (sts == Globals.ReturnStatus.Success)
   1.149 -                                    {
   1.150 -                                        Globals.LogVerbose("ProcessAndGetColorRating: Creating mirror and encrypting.");
   1.151 -
   1.152 -                                        rslt = msgProcessor.Encrypt(internalMessage, null, out newMessage);
   1.153 -                                        tcolor = _pEp_color.pEp_rating_trusted;
   1.154 -
   1.155 -                                        if ((rslt == false) ||
   1.156 -                                            (newMessage == null))
   1.157 -                                        {
   1.158 -                                            // Do nothing, encryption failed
   1.159 -                                            this._LastProcessingStatus = Globals.ReturnStatus.Failure;
   1.160 -                                            tcolor = _pEp_color.pEp_rating_undefined;
   1.161 -                                            Globals.Log("ProcessAndGetColorRating: Encryption failed.");
   1.162 -                                        }
   1.163 -                                        else
   1.164 -                                        {
   1.165 -                                            mirror = CryptableMailItem.FindMirrorOMI(this.internalMailItem);
   1.166 -                                            if (mirror == null)
   1.167 -                                            { mirror = this.CreateMirrorOMI(); }
   1.168 -
   1.169 -                                            CryptableMailItem.SetStoredRating(mirror, tcolor); // Also saves after .ApplyTo
   1.170 -                                            newMessage.ApplyTo(this.internalMailItem, false);  // Do NOT include internal Header Fields (MAPI properties)!
   1.171 -                                        }
   1.172 -
   1.173 -                                        result = tcolor;
   1.174 -                                    }
   1.175 -                                    else if (sts == Globals.ReturnStatus.FailureNoConnection)
   1.176 -                                    {
   1.177 -                                        this._LastProcessingStatus = Globals.ReturnStatus.FailureNoConnection;
   1.178 -                                        result = _pEp_color.pEp_rating_undefined;
   1.179 -                                    }
   1.180 -                                    else
   1.181 -                                    {
   1.182 -                                        this._LastProcessingStatus = Globals.ReturnStatus.Failure;
   1.183 -                                        result = _pEp_color.pEp_rating_undefined;
   1.184 -                                    }
   1.185 -                                }
   1.186 -                                // Not marked keep confidential
   1.187 -                                // This does not have a mirror
   1.188 -                                else
   1.189 -                                {
   1.190 -                                    Globals.LogVerbose("ProcessAndGetColorRating: Is not marked keep confidential and is unencrypted.");
   1.191 -                                    result = _pEp_color.pEp_rating_unencrypted;
   1.192 -                                }
   1.193 +                                Globals.LogVerbose("ProcessAndGetColorRating: Is unencrypted.");
   1.194 +                                result = _pEp_color.pEp_rating_unencrypted;
   1.195                              }
   1.196                          }
   1.197                          // Incoming
   1.198 @@ -1218,7 +1155,7 @@
   1.199                          {
   1.200                              Globals.LogVerbose("ProcessAndGetColorRating: Is incoming.");
   1.201  
   1.202 -                            // Encrypted mail in an encrypted (untrusted store)
   1.203 +                            // Encrypted mail in an encrypted (untrusted store) or marked never unsecure
   1.204                              // This will use a mirror
   1.205                              if (PEPMessage.GetIsEncrypted(this.internalMailItem))
   1.206                              {
   1.207 @@ -1296,65 +1233,17 @@
   1.208                                      }
   1.209                                  }
   1.210                              }
   1.211 -                            // Unencrypted mail in an encrypted (untrusted store)
   1.212 +                            // Unencrypted mail in an encrypted (untrusted store) or marked never unsecure
   1.213 +                            // This does not have a mirror
   1.214                              else
   1.215                              {
   1.216 -                                // Marked keep confidential
   1.217 -                                // This will use a mirror
   1.218 -                                if (CryptableMailItem.GetIsKeepConfidential(this.internalMailItem))
   1.219 +                                Globals.LogVerbose("ProcessAndGetColorRating: Is unencrypted.");
   1.220 +                                result = _pEp_color.pEp_rating_unencrypted;
   1.221 +
   1.222 +                                if (sts == Globals.ReturnStatus.Success)
   1.223                                  {
   1.224 -                                    Globals.LogVerbose("ProcessAndGetColorRating: Is marked keep confidential.");
   1.225 -
   1.226 -                                    if (sts == Globals.ReturnStatus.Success)
   1.227 -                                    {
   1.228 -                                        Globals.LogVerbose("ProcessAndGetColorRating: Creating mirror and encrypting.");
   1.229 -
   1.230 -                                        rslt = msgProcessor.Encrypt(internalMessage, null, out newMessage);
   1.231 -                                        tcolor = _pEp_color.pEp_rating_trusted;
   1.232 -
   1.233 -                                        if ((rslt == false) ||
   1.234 -                                            (newMessage == null))
   1.235 -                                        {
   1.236 -                                            // Do nothing, encryption failed
   1.237 -                                            this._LastProcessingStatus = Globals.ReturnStatus.Failure;
   1.238 -                                            tcolor = _pEp_color.pEp_rating_undefined;
   1.239 -                                            Globals.Log("ProcessAndGetColorRating: Encryption failed.");
   1.240 -                                        }
   1.241 -                                        else
   1.242 -                                        {
   1.243 -                                            mirror = CryptableMailItem.FindMirrorOMI(this.internalMailItem);
   1.244 -                                            if (mirror == null)
   1.245 -                                            { mirror = this.CreateMirrorOMI(); }
   1.246 -
   1.247 -                                            CryptableMailItem.SetStoredRating(mirror, tcolor); // Also saves after .ApplyTo
   1.248 -                                            newMessage.ApplyTo(this.internalMailItem, false);  // Do NOT include internal Header Fields (MAPI properties)!
   1.249 -                                        }
   1.250 -
   1.251 -                                        result = tcolor;
   1.252 -                                    }
   1.253 -                                    else if (sts == Globals.ReturnStatus.FailureNoConnection)
   1.254 -                                    {
   1.255 -                                        this._LastProcessingStatus = Globals.ReturnStatus.FailureNoConnection;
   1.256 -                                        result = _pEp_color.pEp_rating_undefined;
   1.257 -                                    }
   1.258 -                                    else
   1.259 -                                    {
   1.260 -                                        this._LastProcessingStatus = Globals.ReturnStatus.Failure;
   1.261 -                                        result = _pEp_color.pEp_rating_undefined;
   1.262 -                                    }
   1.263 -                                }
   1.264 -                                // Not marked keep confidential
   1.265 -                                // This does not have a mirror
   1.266 -                                else
   1.267 -                                {
   1.268 -                                    Globals.LogVerbose("ProcessAndGetColorRating: Is not marked keep confidential and is unencrypted.");
   1.269 -                                    result = _pEp_color.pEp_rating_unencrypted;
   1.270 -
   1.271 -                                    if (sts == Globals.ReturnStatus.Success)
   1.272 -                                    {
   1.273 -                                        // Call Decrypt to process the message, keylist and decrypted message can be ignored
   1.274 -                                        msgProcessor.Decrypt(internalMessage, out newMessage, out decryptionKeylist);
   1.275 -                                    }
   1.276 +                                    // Call Decrypt to process the message, keylist and decrypted message can be ignored
   1.277 +                                    msgProcessor.Decrypt(internalMessage, out newMessage, out decryptionKeylist);
   1.278                                  }
   1.279                              }
   1.280                          }
   1.281 @@ -1362,7 +1251,6 @@
   1.282                          else
   1.283                          {
   1.284                              Globals.LogVerbose("ProcessAndGetColorRating: Is outgoing.");
   1.285 -
   1.286                              result = this.OutgoingColorRating;
   1.287                          }
   1.288                      }
   1.289 @@ -1497,11 +1385,10 @@
   1.290                                  }
   1.291                              }
   1.292                          }
   1.293 -                        // Assume it is outgoing
   1.294 +                        // Outgoing
   1.295                          else
   1.296                          {
   1.297                              Globals.LogVerbose("ProcessAndGetColorRating: Is outgoing.");
   1.298 -
   1.299                              result = this.OutgoingColorRating;
   1.300                          }
   1.301                      }
   1.302 @@ -2521,17 +2408,17 @@
   1.303          }
   1.304  
   1.305          /// <summary>
   1.306 -        /// Gets whether the given Outlook mail item is marked to keep confidential.
   1.307 +        /// Gets whether the given Outlook mail item is marked to never be unsecure.
   1.308          /// </summary>
   1.309 -        /// <param name="omi">The Outlook mail item to check keep confidential status for.</param>
   1.310 -        /// <returns>True if the Outlook mail item is marked to keep confidential, otherwise false.</returns>
   1.311 -        public static bool GetIsKeepConfidential(Outlook.MailItem omi)
   1.312 +        /// <param name="omi">The Outlook mail item to check the never unsecure status for.</param>
   1.313 +        /// <returns>True if the Outlook mail item is marked to never be unsecure, otherwise false.</returns>
   1.314 +        public static bool GetIsNeverUnsecure(Outlook.MailItem omi)
   1.315          {
   1.316              object propValue;
   1.317  
   1.318              // Return status can be ignored here, using the auto default value is good enough
   1.319              CryptableMailItem.GetInterpretedProperty(omi,
   1.320 -                                                     PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
   1.321 +                                                     PEPMessage.PR_X_PEP_NEVER_UNSECURE,
   1.322                                                       out propValue);
   1.323  
   1.324              return ((bool)propValue);
   1.325 @@ -2539,7 +2426,7 @@
   1.326  
   1.327          /// <summary>
   1.328          /// Determines if the given Outlook mail item should be stored encrypted (use a mirror).
   1.329 -        /// This will check three properties: IsInEncryptedStore, IsEncrypted &amp; KeepConfidential.
   1.330 +        /// This will check the properties: IsInEncryptedStore, IsEncrypted, IsMirror &amp; NeverUnsecure.
   1.331          /// </summary>
   1.332          /// <param name="omi">The Outlook mail item to check if it should be stored encrypted.</param>
   1.333          /// <returns>True if the Outlook mail item should be stored encrypted, otherwise false.</returns>
   1.334 @@ -2555,7 +2442,7 @@
   1.335                  isMirror = true;
   1.336              }
   1.337  
   1.338 -            if ((CryptableMailItem.GetIsKeepConfidential(omi) &&
   1.339 +            if ((CryptableMailItem.GetIsNeverUnsecure(omi) &&
   1.340                   (isMirror == false)) ||
   1.341                  (CryptableMailItem.GetIsInEncryptedStore(omi) &&
   1.342                   PEPMessage.GetIsEncrypted(omi)))
   1.343 @@ -2857,8 +2744,8 @@
   1.344                              newValue = null;
   1.345                              break;
   1.346                          }
   1.347 -                    // Keep confidential MAPI property
   1.348 -                    case (PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL):
   1.349 +                    // Never unsecure MAPI property
   1.350 +                    case (PEPMessage.PR_X_PEP_NEVER_UNSECURE):
   1.351                          {
   1.352                              newValue = false;
   1.353                              break;
   1.354 @@ -3005,18 +2892,18 @@
   1.355                                  outValue = MAPIHelper.GetProperty(omi, PEPMessage.PR_X_KEY_LIST, null);
   1.356                                  break;
   1.357                              }
   1.358 -                        // Keep confidential MAPI property
   1.359 -                        case (PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL):
   1.360 +                        // Never unsecure MAPI property
   1.361 +                        case (PEPMessage.PR_X_PEP_NEVER_UNSECURE):
   1.362                              {
   1.363 -                                /* Note that KeepConfidential is defined as:
   1.364 -                                 *   ON : KeepConfidential property exists with ANY value ('1' is the default)
   1.365 -                                 *  OFF : KeepConfidential property does not exist or has a null value
   1.366 +                                /* Note that NeverUnsecure is defined as:
   1.367 +                                 *   ON : NeverUnsecure property exists with ANY value ('1' is the default)
   1.368 +                                 *  OFF : NeverUnsecure property does not exist or has a null value
   1.369                                   */
   1.370  
   1.371                                  outValue = CryptableMailItem.GetInterpretedPropertyDefault(propertyName);
   1.372 -                                property = MAPIHelper.GetProperty(omi, PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL, null);
   1.373 -
   1.374 -                                // Only check that the KeepConfidential property exists, the value is ignored
   1.375 +                                property = MAPIHelper.GetProperty(omi, PEPMessage.PR_X_PEP_NEVER_UNSECURE, null);
   1.376 +
   1.377 +                                // Only check that the NeverUnsecure property exists, the value is ignored
   1.378                                  if (property != null)
   1.379                                  {
   1.380                                      outValue = true;
   1.381 @@ -3149,20 +3036,20 @@
   1.382                                  MAPIHelper.SetProperty(omi, PEPMessage.PR_X_KEY_LIST, value);
   1.383                                  break;
   1.384                              }
   1.385 -                        // Keep confidential MAPI property
   1.386 -                        case (PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL):
   1.387 +                        // Never unsecure MAPI property
   1.388 +                        case (PEPMessage.PR_X_PEP_NEVER_UNSECURE):
   1.389                              {
   1.390                                  if (value is bool)
   1.391                                  {
   1.392                                      if ((bool)value)
   1.393                                      {
   1.394 -                                        MAPIHelper.SetProperty(omi, PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL, "1");
   1.395 +                                        MAPIHelper.SetProperty(omi, PEPMessage.PR_X_PEP_NEVER_UNSECURE, "1");
   1.396                                          Save(omi);
   1.397                                      }
   1.398                                      else
   1.399                                      {
   1.400 -                                        // The property MUST be deleted when the MailItem should not be kept confidential.
   1.401 -                                        MAPIHelper.DeleteProperty(omi, PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL);
   1.402 +                                        // The property MUST be deleted when the MailItem should not be marked never unsecure
   1.403 +                                        MAPIHelper.DeleteProperty(omi, PEPMessage.PR_X_PEP_NEVER_UNSECURE);
   1.404                                          Save(omi);
   1.405                                      }
   1.406  
     2.1 --- a/PEPMessage.cs	Wed Aug 03 10:26:32 2016 +0200
     2.2 +++ b/PEPMessage.cs	Thu Aug 04 06:46:44 2016 -0700
     2.3 @@ -21,16 +21,16 @@
     2.4          public event PropertyChangedEventHandler PropertyChanged;
     2.5  
     2.6          // pEp properties
     2.7 -        public const string PR_OPT_FIELD               = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/";
     2.8 -        public const string PR_X_ENC_STATUS            = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-EncStatus";
     2.9 -        public const string PR_X_KEY_LIST              = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-KeyList";
    2.10 -        public const string PR_X_PEP_KEEP_CONFIDENTIAL = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-pEp-Keep-Confidential";
    2.11 -        public const string PR_X_PEP_VERSION           = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-pEp-Version";
    2.12 +        public const string PR_OPT_FIELD            = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/";
    2.13 +        public const string PR_X_ENC_STATUS         = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-EncStatus";
    2.14 +        public const string PR_X_KEY_LIST           = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-KeyList";
    2.15 +        public const string PR_X_PEP_NEVER_UNSECURE = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-pEp-Never-Unsecure";
    2.16 +        public const string PR_X_PEP_VERSION        = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-pEp-Version";
    2.17  
    2.18 -        public const string PR_X_ENC_STATUS_NAME            = "X-EncStatus";
    2.19 -        public const string PR_X_KEY_LIST_NAME              = "X-KeyList";
    2.20 -        public const string PR_X_PEP_KEEP_CONFIDENTIAL_NAME = "X-pEp-Keep-Confidential";
    2.21 -        public const string PR_X_PEP_VERSION_NAME           = "X-pEp-Version";
    2.22 +        public const string PR_X_ENC_STATUS_NAME         = "X-EncStatus";
    2.23 +        public const string PR_X_KEY_LIST_NAME           = "X-KeyList";
    2.24 +        public const string PR_X_PEP_NEVER_UNSECURE_NAME = "X-pEp-Never-Unsecure";
    2.25 +        public const string PR_X_PEP_VERSION_NAME        = "X-pEp-Version";
    2.26  
    2.27          private List<PEPAttachment> _Attachments;
    2.28          private bool                _AttachOwnKey;
    2.29 @@ -41,12 +41,12 @@
    2.30          private bool                _ForceUnencrypted;
    2.31          private PEPIdentity         _From;
    2.32          private string              _ID;
    2.33 -        private bool                _KeepConfidential;
    2.34          private string              _KeyList;
    2.35          private List<string>        _Keywords;
    2.36          private string              _LongMsg;
    2.37          private string              _LongMsgFormattedHTML;
    2.38          private string              _LongMsgFormattedRTF;
    2.39 +        private bool                _NeverUnsecure;
    2.40          private string              _PEPVersion;
    2.41          private DateTime?           _ReceivedOn;
    2.42          private DateTime?           _SentOn;
    2.43 @@ -239,24 +239,6 @@
    2.44          }
    2.45  
    2.46          /// <summary>
    2.47 -        /// Gets or sets whether this message is marked to keep confidential.
    2.48 -        /// Note: While this is stored as a header field, it is OK to apply to any MailItem and outgoing messages.
    2.49 -        /// It's intended function is to flag a message to keep it encrypted.
    2.50 -        ///          MailItem : Corresponds to MAPI Property PR_X_PEP_KEEP_CONFIDENTIAL (Header field)
    2.51 -        /// CryptableMailItem : Corresponds to property 'KeepConfidential'
    2.52 -        ///      text_message : not supported
    2.53 -        /// </summary>
    2.54 -        public bool KeepConfidential
    2.55 -        {
    2.56 -            get { return (this._KeepConfidential); }
    2.57 -            set
    2.58 -            {
    2.59 -                this._KeepConfidential = value;
    2.60 -                this.RaisePropertyChangedEvent("KeepConfidential");
    2.61 -            }
    2.62 -        }
    2.63 -
    2.64 -        /// <summary>
    2.65          /// Gets or sets the list of keys associated with this message.
    2.66          /// Commonly this contains the list of decryption keys.
    2.67          /// Warning: Since this is stored as a header field, care must be taken not to apply this to a MailItem on an 
    2.68 @@ -340,6 +322,24 @@
    2.69          }
    2.70  
    2.71          /// <summary>
    2.72 +        /// Gets or sets whether this message is marked to never be unsecure.
    2.73 +        /// Note: While this is stored as a header field, it is OK to apply to any MailItem and outgoing messages.
    2.74 +        /// It's intended function is to flag a message to keep it encrypted.
    2.75 +        ///          MailItem : Corresponds to MAPI Property PR_X_PEP_NEVER_UNSECURE (Header field)
    2.76 +        /// CryptableMailItem : Corresponds to property 'NeverUnsecure'
    2.77 +        ///      text_message : not supported
    2.78 +        /// </summary>
    2.79 +        public bool NeverUnsecure
    2.80 +        {
    2.81 +            get { return (this._NeverUnsecure); }
    2.82 +            set
    2.83 +            {
    2.84 +                this._NeverUnsecure = value;
    2.85 +                this.RaisePropertyChangedEvent("NeverUnsecure");
    2.86 +            }
    2.87 +        }
    2.88 +
    2.89 +        /// <summary>
    2.90          /// Gets or sets the version of the pEp engine used for processing this message.
    2.91          /// This is commonly set after decryption.
    2.92          /// Note: While this is stored as a header field, it is OK to apply to any MailItem and outgoing messages.
    2.93 @@ -545,10 +545,10 @@
    2.94              }
    2.95  
    2.96              if ((alwaysAddOptFields) ||
    2.97 -                (this._KeepConfidential == true))
    2.98 +                (this._NeverUnsecure == true))
    2.99              {
   2.100                  field = new opt_field();
   2.101 -                field.name = PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL_NAME;
   2.102 +                field.name = PEPMessage.PR_X_PEP_NEVER_UNSECURE_NAME;
   2.103                  field.value = "1";
   2.104                  optionalFields.Add(field);
   2.105              }
   2.106 @@ -585,7 +585,7 @@
   2.107               * 
   2.108               * Also not the following are handled as optional fields
   2.109               *   • ColorRating
   2.110 -             *   • KeepConfidential
   2.111 +             *   • NeverUnsecure
   2.112               *   • KeyList
   2.113               *   • PEPVersion
   2.114               * 
   2.115 @@ -659,7 +659,6 @@
   2.116              copy.ForceUnencrypted = this._ForceUnencrypted;
   2.117              copy.From = (this._From == null ? null : this._From.Copy());
   2.118              copy.ID = this._ID;
   2.119 -            copy.KeepConfidential = this._KeepConfidential;
   2.120              copy.KeyList = this._KeyList;
   2.121  
   2.122              // Keywords
   2.123 @@ -683,6 +682,7 @@
   2.124                  copy.LongMsgFormattedRTF = null;
   2.125              }
   2.126  
   2.127 +            copy.NeverUnsecure = this._NeverUnsecure;
   2.128              copy.PEPVersion = this._PEPVersion;
   2.129  
   2.130              // ReceivedOn
   2.131 @@ -731,12 +731,12 @@
   2.132              this._ForceUnencrypted = false;
   2.133              this._From = null;
   2.134              this._ID = null;
   2.135 -            this._KeepConfidential = false;
   2.136              this._KeyList = null;
   2.137              this._Keywords = new List<string>();
   2.138              this._LongMsg = null;
   2.139              this._LongMsgFormattedHTML = null;
   2.140              this._LongMsgFormattedRTF = null;
   2.141 +            this._NeverUnsecure = false;
   2.142              this._PEPVersion = null;
   2.143              this._ReceivedOn = null;
   2.144              this._SentOn = null;
   2.145 @@ -752,12 +752,12 @@
   2.146              this.RaisePropertyChangedEvent("ForceUnencrypted");
   2.147              this.RaisePropertyChangedEvent("From");
   2.148              this.RaisePropertyChangedEvent("ID");
   2.149 -            this.RaisePropertyChangedEvent("KeepConfidential");
   2.150              this.RaisePropertyChangedEvent("KeyList");
   2.151              this.RaisePropertyChangedEvent("Keywords");
   2.152              this.RaisePropertyChangedEvent("LongMsg");
   2.153              this.RaisePropertyChangedEvent("LongMsgFormattedHTML");
   2.154              this.RaisePropertyChangedEvent("LongMsgFormattedRTF");
   2.155 +            this.RaisePropertyChangedEvent("NeverUnsecure");
   2.156              this.RaisePropertyChangedEvent("PEPVersion");
   2.157              this.RaisePropertyChangedEvent("ReceivedOn");
   2.158              this.RaisePropertyChangedEvent("SentOn");
   2.159 @@ -779,7 +779,7 @@
   2.160              /* Include the following properties:
   2.161               *   • AttachOwnKey
   2.162               *   • ForceUnencrypted
   2.163 -             *   • KeepConfidential
   2.164 +             *   • NeverUnsecure
   2.165               * 
   2.166               * Also note:
   2.167               *         ColorRating: This is handled by the decrypt function of the engine only. It should not be
   2.168 @@ -796,11 +796,11 @@
   2.169              {
   2.170                  this._AttachOwnKey = msg.AttachOwnKey;
   2.171                  this._ForceUnencrypted = msg.ForceUnencrypted;
   2.172 -                this._KeepConfidential = msg.KeepConfidential;
   2.173 +                this._NeverUnsecure = msg.NeverUnsecure;
   2.174  
   2.175                  this.RaisePropertyChangedEvent("AttachOwnKey");
   2.176                  this.RaisePropertyChangedEvent("ForceUnencrypted");
   2.177 -                this.RaisePropertyChangedEvent("KeepConfidential");
   2.178 +                this.RaisePropertyChangedEvent("NeverUnsecure");
   2.179              }
   2.180  
   2.181              return;
   2.182 @@ -812,7 +812,7 @@
   2.183          /// <param name="omi">The Outlook mail item to apply this pEp message's data to.</param>
   2.184          /// <param name="includeInternalHeaderFields">Whether to include internal header fields (Stored as MAPI properites) such as 
   2.185          /// ColorRating and KeyList. Warning: Never apply these to outgoing messages -- used only for mirrors or internal MailItems.
   2.186 -        /// Note that some header fields will be applied regardless such as KeepConfidential or PEPVersion. 
   2.187 +        /// Note that some header fields will be applied regardless such as NeverUnsecure or PEPVersion. 
   2.188          /// That is because these are not considered internal only and don't contain sensitive information.</param>
   2.189          /// <returns>The status of the method.</returns>
   2.190          public Globals.ReturnStatus ApplyTo(Outlook.MailItem omi,
   2.191 @@ -1019,10 +1019,10 @@
   2.192                                                               this._KeyList);
   2.193                  }
   2.194  
   2.195 -                // KeepConfidential, ignore return status
   2.196 +                // NeverUnsecure, ignore return status
   2.197                  CryptableMailItem.SetInterpretedProperty(omi,
   2.198 -                                                         PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
   2.199 -                                                         this._KeepConfidential);
   2.200 +                                                         PEPMessage.PR_X_PEP_NEVER_UNSECURE,
   2.201 +                                                         this._NeverUnsecure);
   2.202  
   2.203                  // PEPVersion, ignore return status
   2.204                  CryptableMailItem.SetInterpretedProperty(omi,
   2.205 @@ -1271,8 +1271,8 @@
   2.206                   * 
   2.207                   * Also not the following are handled as optional fields
   2.208                   *   • ColorRating
   2.209 -                 *   • KeepConfidential
   2.210                   *   • KeyList
   2.211 +                 *   • NeverUnsecure
   2.212                   *   • PEPVersion
   2.213                   * 
   2.214                   * This also skips a number of text_message properties currently unsupported in PEPMessage.
   2.215 @@ -1352,10 +1352,10 @@
   2.216                                          newMessage.KeyList = msg.opt_fields[i].value;
   2.217                                          break;
   2.218                                      }
   2.219 -                                case (PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL_NAME):
   2.220 +                                case (PEPMessage.PR_X_PEP_NEVER_UNSECURE_NAME):
   2.221                                      {
   2.222                                          // If it exists it's true, value doesn't matter
   2.223 -                                        newMessage.KeepConfidential = true;
   2.224 +                                        newMessage.NeverUnsecure = true;
   2.225                                          break;
   2.226                                      }
   2.227                                  case (PEPMessage.PR_X_PEP_VERSION_NAME):
   2.228 @@ -1593,11 +1593,11 @@
   2.229                                                           out propValue);
   2.230                  newMessage.KeyList = (string)propValue;
   2.231  
   2.232 -                // KeepConfidential
   2.233 +                // NeverUnsecure
   2.234                  CryptableMailItem.GetInterpretedProperty(omi,
   2.235 -                                                         PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
   2.236 +                                                         PEPMessage.PR_X_PEP_NEVER_UNSECURE,
   2.237                                                           out propValue);
   2.238 -                newMessage.KeepConfidential = (bool)propValue;
   2.239 +                newMessage.NeverUnsecure = (bool)propValue;
   2.240  
   2.241                  // PEPVersion
   2.242                  CryptableMailItem.GetInterpretedProperty(omi,
     3.1 --- a/Properties/Resources.Designer.cs	Wed Aug 03 10:26:32 2016 +0200
     3.2 +++ b/Properties/Resources.Designer.cs	Thu Aug 04 06:46:44 2016 -0700
     3.3 @@ -299,9 +299,9 @@
     3.4          /// <summary>
     3.5          ///   Looks up a localized resource of type System.Drawing.Bitmap.
     3.6          /// </summary>
     3.7 -        internal static System.Drawing.Bitmap ImageKeepConfidentialOff {
     3.8 +        internal static System.Drawing.Bitmap ImageNeverUnsecureOff {
     3.9              get {
    3.10 -                object obj = ResourceManager.GetObject("ImageKeepConfidentialOff", resourceCulture);
    3.11 +                object obj = ResourceManager.GetObject("ImageNeverUnsecureOff", resourceCulture);
    3.12                  return ((System.Drawing.Bitmap)(obj));
    3.13              }
    3.14          }
    3.15 @@ -309,9 +309,9 @@
    3.16          /// <summary>
    3.17          ///   Looks up a localized resource of type System.Drawing.Bitmap.
    3.18          /// </summary>
    3.19 -        internal static System.Drawing.Bitmap ImageKeepConfidentialOn {
    3.20 +        internal static System.Drawing.Bitmap ImageNeverUnsecureOn {
    3.21              get {
    3.22 -                object obj = ResourceManager.GetObject("ImageKeepConfidentialOn", resourceCulture);
    3.23 +                object obj = ResourceManager.GetObject("ImageNeverUnsecureOn", resourceCulture);
    3.24                  return ((System.Drawing.Bitmap)(obj));
    3.25              }
    3.26          }
    3.27 @@ -1502,20 +1502,20 @@
    3.28          }
    3.29          
    3.30          /// <summary>
    3.31 -        ///   Looks up a localized string similar to Keep Confidential.
    3.32 +        ///   Looks up a localized string similar to Never Unprotected.
    3.33          /// </summary>
    3.34 -        internal static string Ribbon_KeepConfidential {
    3.35 +        internal static string Ribbon_NeverUnsecure {
    3.36              get {
    3.37 -                return ResourceManager.GetString("Ribbon_KeepConfidential", resourceCulture);
    3.38 +                return ResourceManager.GetString("Ribbon_NeverUnsecure", resourceCulture);
    3.39              }
    3.40          }
    3.41          
    3.42          /// <summary>
    3.43          ///   Looks up a localized string similar to Ensures that this message is stored securely by p≡p..
    3.44          /// </summary>
    3.45 -        internal static string Ribbon_KeepConfidentialDesc {
    3.46 +        internal static string Ribbon_NeverUnsecureDesc {
    3.47              get {
    3.48 -                return ResourceManager.GetString("Ribbon_KeepConfidentialDesc", resourceCulture);
    3.49 +                return ResourceManager.GetString("Ribbon_NeverUnsecureDesc", resourceCulture);
    3.50              }
    3.51          }
    3.52      }
     4.1 --- a/Properties/Resources.resx	Wed Aug 03 10:26:32 2016 +0200
     4.2 +++ b/Properties/Resources.resx	Thu Aug 04 06:46:44 2016 -0700
     4.3 @@ -193,11 +193,11 @@
     4.4    <data name="ImageForceUnencOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
     4.5      <value>..\Resources\ImageForceUnencOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     4.6    </data>
     4.7 -  <data name="ImageKeepConfidentialOff" type="System.Resources.ResXFileRef, System.Windows.Forms">
     4.8 -    <value>..\Resources\ImageKeepConfidentialOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     4.9 +  <data name="ImageNeverUnsecureOff" type="System.Resources.ResXFileRef, System.Windows.Forms">
    4.10 +    <value>..\Resources\ImageNeverUnsecureOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    4.11    </data>
    4.12 -  <data name="ImageKeepConfidentialOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
    4.13 -    <value>..\Resources\ImageKeepConfidentialOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    4.14 +  <data name="ImageNeverUnsecureOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
    4.15 +    <value>..\Resources\ImageNeverUnsecureOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    4.16    </data>
    4.17    <data name="ImageLogoLarge" type="System.Resources.ResXFileRef, System.Windows.Forms">
    4.18      <value>..\Resources\ImageLogoLarge.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
    4.19 @@ -589,10 +589,10 @@
    4.20    <data name="Ribbon_GroupCompatibilityLabel" xml:space="preserve">
    4.21      <value>Compatibility Options</value>
    4.22    </data>
    4.23 -  <data name="Ribbon_KeepConfidential" xml:space="preserve">
    4.24 -    <value>Keep Confidential</value>
    4.25 +  <data name="Ribbon_NeverUnsecure" xml:space="preserve">
    4.26 +    <value>Never Unprotected</value>
    4.27    </data>
    4.28 -  <data name="Ribbon_KeepConfidentialDesc" xml:space="preserve">
    4.29 +  <data name="Ribbon_NeverUnsecureDesc" xml:space="preserve">
    4.30      <value>Ensures that this message is stored securely by p≡p.</value>
    4.31    </data>
    4.32  </root>
    4.33 \ No newline at end of file
     5.1 Binary file Resources/ImageKeepConfidentialOff.png has changed
     6.1 Binary file Resources/ImageKeepConfidentialOn.png has changed
     7.1 Binary file Resources/ImageNeverUnsecureOff.png has changed
     8.1 Binary file Resources/ImageNeverUnsecureOn.png has changed
     9.1 --- a/UI/RibbonCustomizations.cs	Wed Aug 03 10:26:32 2016 +0200
     9.2 +++ b/UI/RibbonCustomizations.cs	Thu Aug 04 06:46:44 2016 -0700
     9.3 @@ -28,9 +28,9 @@
     9.4              ForceUnencryptedUserProperty,
     9.5  
     9.6              /// <summary>
     9.7 -            /// Corresponds with the Mailitem MAPI property for whether to keep confidential.
     9.8 +            /// Corresponds with the Mailitem MAPI property marking as never unsecure.
     9.9              /// </summary>
    9.10 -            KeepConfidentialProperty
    9.11 +            NeverUnsecureProperty
    9.12          }
    9.13  
    9.14          /* Notes:
    9.15 @@ -118,8 +118,8 @@
    9.16                  case (EnumProperty.ForceUnencryptedUserProperty):
    9.17                      result = CryptableMailItem.GetInterpretedPropertyDefault(CryptableMailItem.USER_PROPERTY_KEY_FORCE_UNENCRYPTED);
    9.18                      break;
    9.19 -                case (EnumProperty.KeepConfidentialProperty):
    9.20 -                    result = CryptableMailItem.GetInterpretedPropertyDefault(PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL);
    9.21 +                case (EnumProperty.NeverUnsecureProperty):
    9.22 +                    result = CryptableMailItem.GetInterpretedPropertyDefault(PEPMessage.PR_X_PEP_NEVER_UNSECURE);
    9.23                      break;
    9.24              }
    9.25  
    9.26 @@ -154,11 +154,11 @@
    9.27                                      result = (bool)propValue;
    9.28                                      break;
    9.29                                  }
    9.30 -                            case (EnumProperty.KeepConfidentialProperty):
    9.31 +                            case (EnumProperty.NeverUnsecureProperty):
    9.32                                  {
    9.33                                      // Return status can be ignored here, using the auto default value is good enough
    9.34                                      CryptableMailItem.GetInterpretedProperty(currMailItem,
    9.35 -                                                                             PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
    9.36 +                                                                             PEPMessage.PR_X_PEP_NEVER_UNSECURE,
    9.37                                                                               out propValue);
    9.38                                      result = (bool)propValue;
    9.39                                      break;
    9.40 @@ -201,7 +201,7 @@
    9.41  
    9.42                                      break;
    9.43                                  }
    9.44 -                            case (EnumProperty.KeepConfidentialProperty):
    9.45 +                            case (EnumProperty.NeverUnsecureProperty):
    9.46                                  {
    9.47                                      // Not supported
    9.48                                      break;
    9.49 @@ -284,14 +284,14 @@
    9.50  
    9.51                                      break;
    9.52                                  }
    9.53 -                            case (EnumProperty.KeepConfidentialProperty):
    9.54 +                            case (EnumProperty.NeverUnsecureProperty):
    9.55                                  {
    9.56                                      if ((value != null) &&
    9.57                                          (value is bool))
    9.58                                      {
    9.59                                          // Return status can be ignored
    9.60                                          CryptableMailItem.SetInterpretedProperty(currMailItem,
    9.61 -                                                                                 PEPMessage.PR_X_PEP_KEEP_CONFIDENTIAL,
    9.62 +                                                                                 PEPMessage.PR_X_PEP_NEVER_UNSECURE,
    9.63                                                                                   value);
    9.64                                      }
    9.65  
    9.66 @@ -348,7 +348,7 @@
    9.67  
    9.68                                      break;
    9.69                                  }
    9.70 -                            case (EnumProperty.KeepConfidentialProperty):
    9.71 +                            case (EnumProperty.NeverUnsecureProperty):
    9.72                                  {
    9.73                                      // Not supported
    9.74                                      break;
    9.75 @@ -388,8 +388,8 @@
    9.76          /// </summary>
    9.77          public bool ToggleButtonForceUnencrypted_GetEnabled(Office.IRibbonControl control)
    9.78          {
    9.79 -            // When a message is marked as keep confidential, it cannot be forcefully unencrypted
    9.80 -            if ((bool)this.GetProperty(EnumProperty.KeepConfidentialProperty))
    9.81 +            // When a message is marked as never unsecure, it cannot be forcefully unencrypted
    9.82 +            if ((bool)this.GetProperty(EnumProperty.NeverUnsecureProperty))
    9.83              {
    9.84                  return (false);
    9.85              }
    9.86 @@ -572,15 +572,15 @@
    9.87          }
    9.88  
    9.89          ///////////////////////////////////////////////////////////
    9.90 -        // ToggleButtonKeepConfidential
    9.91 +        // ToggleButtonNeverUnsecure
    9.92          ///////////////////////////////////////////////////////////
    9.93  
    9.94          /// <summary>
    9.95 -        /// Callback to get whether the ToggleButtonKeepConfidential is enabled.
    9.96 +        /// Callback to get whether the ToggleButtonNeverUnsecure is enabled.
    9.97          /// </summary>
    9.98 -        public bool ToggleButtonKeepConfidential_GetEnabled(Office.IRibbonControl control)
    9.99 +        public bool ToggleButtonNeverUnsecure_GetEnabled(Office.IRibbonControl control)
   9.100          {
   9.101 -            // When a message is being sent forcefully unencrypted, it cannot be kept confidential
   9.102 +            // When a message is being sent forcefully unencrypted, it cannot be marked never unsecure
   9.103              if ((bool)this.GetProperty(EnumProperty.ForceUnencryptedUserProperty))
   9.104              {
   9.105                  return (false);
   9.106 @@ -592,48 +592,48 @@
   9.107          }
   9.108  
   9.109          /// <summary>
   9.110 -        /// Callback to get the image for the ToggleButtonKeepConfidential.
   9.111 +        /// Callback to get the image for the ToggleButtonNeverUnsecure.
   9.112          /// </summary>
   9.113 -        public System.Drawing.Bitmap ToggleButtonKeepConfidential_GetImage(Office.IRibbonControl control)
   9.114 +        public System.Drawing.Bitmap ToggleButtonNeverUnsecure_GetImage(Office.IRibbonControl control)
   9.115          {
   9.116 -            if ((bool)this.GetProperty(EnumProperty.KeepConfidentialProperty))
   9.117 +            if ((bool)this.GetProperty(EnumProperty.NeverUnsecureProperty))
   9.118              {
   9.119 -                return (Properties.Resources.ImageKeepConfidentialOn);
   9.120 +                return (Properties.Resources.ImageNeverUnsecureOn);
   9.121              }
   9.122              else
   9.123              {
   9.124 -                return (Properties.Resources.ImageKeepConfidentialOff);
   9.125 +                return (Properties.Resources.ImageNeverUnsecureOff);
   9.126              }
   9.127          }
   9.128  
   9.129          /// <summary>
   9.130 -        /// Callback to get the label text for the ToggleButtonKeepConfidential.
   9.131 +        /// Callback to get the label text for the ToggleButtonNeverUnsecure.
   9.132          /// </summary>
   9.133 -        public string ToggleButtonKeepConfidential_GetLabel(Office.IRibbonControl control)
   9.134 +        public string ToggleButtonNeverUnsecure_GetLabel(Office.IRibbonControl control)
   9.135          {
   9.136 -            return (pEp.Properties.Resources.Ribbon_KeepConfidential);
   9.137 +            return (pEp.Properties.Resources.Ribbon_NeverUnsecure);
   9.138          }
   9.139  
   9.140          /// <summary>
   9.141 -        /// Callback to get whether the ToggleButtonKeepConfidential is pressed.
   9.142 +        /// Callback to get whether the ToggleButtonNeverUnsecure is pressed.
   9.143          /// </summary>
   9.144 -        public bool ToggleButtonKeepConfidential_GetPressed(Office.IRibbonControl control)
   9.145 +        public bool ToggleButtonNeverUnsecure_GetPressed(Office.IRibbonControl control)
   9.146          {
   9.147 -            return ((bool)this.GetProperty(EnumProperty.KeepConfidentialProperty));
   9.148 +            return ((bool)this.GetProperty(EnumProperty.NeverUnsecureProperty));
   9.149          }
   9.150  
   9.151          /// <summary>
   9.152 -        /// Callback to get the supertip/description text for the ToggleButtonKeepConfidential.
   9.153 +        /// Callback to get the supertip/description text for the ToggleButtonNeverUnsecure.
   9.154          /// </summary>
   9.155 -        public string ToggleButtonKeepConfidential_GetSupertip(Office.IRibbonControl control)
   9.156 +        public string ToggleButtonNeverUnsecure_GetSupertip(Office.IRibbonControl control)
   9.157          {
   9.158 -            return (pEp.Properties.Resources.Ribbon_KeepConfidentialDesc);
   9.159 +            return (pEp.Properties.Resources.Ribbon_NeverUnsecureDesc);
   9.160          }
   9.161  
   9.162          /// <summary>
   9.163 -        /// Callback to get whether the ToggleButtonKeepConfidential is visible.
   9.164 +        /// Callback to get whether the ToggleButtonNeverUnsecure is visible.
   9.165          /// </summary>
   9.166 -        public bool ToggleButtonKeepConfidential_GetVisible(Office.IRibbonControl control)
   9.167 +        public bool ToggleButtonNeverUnsecure_GetVisible(Office.IRibbonControl control)
   9.168          {
   9.169              return (true); // Unimplemented
   9.170          }
   9.171 @@ -649,124 +649,7 @@
   9.172          {
   9.173              return (Globals.RELEASE_MODE != Globals.ReleaseMode.Reader);
   9.174          }
   9.175 -
   9.176 -        /**************************************************************
   9.177 -         * 
   9.178 -         * Callbacks (Read Message Tab Ribbon)
   9.179 -         * 
   9.180 -         *************************************************************/
   9.181 -
   9.182 -        ///////////////////////////////////////////////////////////
   9.183 -        // ToggleButtonKeepConfidentialRead
   9.184 -        ///////////////////////////////////////////////////////////
   9.185 -
   9.186 -        /// <summary>
   9.187 -        /// Callback to get whether the ToggleButtonKeepConfidentialRead is enabled.
   9.188 -        /// </summary>
   9.189 -        public bool ToggleButtonKeepConfidentialRead_GetEnabled(Office.IRibbonControl control)
   9.190 -        {
   9.191 -            return (false); // Disabled until new engine encrypt funciton for incoming messages
   9.192 -            /*
   9.193 -            bool enabled = true;
   9.194 -            object isMirror;
   9.195 -            Outlook.MailItem currMailItem = null;
   9.196 -            Outlook.Inspector insp = Globals.ThisAddIn.Application.ActiveInspector();
   9.197 -
   9.198 -            if ((insp != null) &&
   9.199 -                (insp.CurrentItem != null) &&
   9.200 -                (insp.CurrentItem is Outlook.MailItem))
   9.201 -            {
   9.202 -                currMailItem = (Outlook.MailItem)insp.CurrentItem;
   9.203 -                isMirror = CryptableMailItem.GetUserProperty(currMailItem, CryptableMailItem.USER_PROPERTY_KEY_IS_MIRROR);
   9.204 -
   9.205 -                * If the mail item being viewed is a mirror itself then the original message is already encrypted.
   9.206 -                 * Therefore, disable the ability to mark this as KeepConfidential.
   9.207 -                 * This is also necessary because otherwise a reverse lookup of the original MailItem from the mirror would be needed.
   9.208 -                 * Then both the original and mirror would have to be updated with any KeepConfidential property changes.
   9.209 -                 * That would be difficult with the current design of the add-in.
   9.210 -                 *
   9.211 -                if ((isMirror != null) &&
   9.212 -                    (((bool)isMirror) == true))
   9.213 -                {
   9.214 -                    enabled = false;
   9.215 -                }
   9.216 -            }
   9.217 -
   9.218 -            if (currMailItem != null)
   9.219 -            {
   9.220 -                Marshal.ReleaseComObject(currMailItem);
   9.221 -                currMailItem = null;
   9.222 -            }
   9.223 -
   9.224 -            if (insp != null)
   9.225 -            {
   9.226 -                Marshal.ReleaseComObject(insp);
   9.227 -                insp = null;
   9.228 -            }
   9.229 -
   9.230 -            return (enabled);
   9.231 -            */
   9.232 -        }
   9.233 -
   9.234 -        /// <summary>
   9.235 -        /// Callback to get the image for the ToggleButtonKeepConfidentialRead.
   9.236 -        /// </summary>
   9.237 -        public System.Drawing.Bitmap ToggleButtonKeepConfidentialRead_GetImage(Office.IRibbonControl control)
   9.238 -        {
   9.239 -            if ((bool)this.GetProperty(EnumProperty.KeepConfidentialProperty))
   9.240 -            {
   9.241 -                return (Properties.Resources.ImageKeepConfidentialOn);
   9.242 -            }
   9.243 -            else
   9.244 -            {
   9.245 -                return (Properties.Resources.ImageKeepConfidentialOff);
   9.246 -            }
   9.247 -        }
   9.248 -
   9.249 -        /// <summary>
   9.250 -        /// Callback to get the label text for the ToggleButtonKeepConfidentialRead.
   9.251 -        /// </summary>
   9.252 -        public string ToggleButtonKeepConfidentialRead_GetLabel(Office.IRibbonControl control)
   9.253 -        {
   9.254 -            return (pEp.Properties.Resources.Ribbon_KeepConfidential);
   9.255 -        }
   9.256 -
   9.257 -        /// <summary>
   9.258 -        /// Callback to get whether the ToggleButtonKeepConfidentialRead is pressed.
   9.259 -        /// </summary>
   9.260 -        public bool ToggleButtonKeepConfidentialRead_GetPressed(Office.IRibbonControl control)
   9.261 -        {
   9.262 -            return ((bool)this.GetProperty(EnumProperty.KeepConfidentialProperty));
   9.263 -        }
   9.264 -
   9.265 -        /// <summary>
   9.266 -        /// Callback to get the supertip/description text for the ToggleButtonKeepConfidentialRead.
   9.267 -        /// </summary>
   9.268 -        public string ToggleButtonKeepConfidentialRead_GetSupertip(Office.IRibbonControl control)
   9.269 -        {
   9.270 -            return (pEp.Properties.Resources.Ribbon_KeepConfidentialDesc);
   9.271 -        }
   9.272 -
   9.273 -        /// <summary>
   9.274 -        /// Callback to get whether the ToggleButtonKeepConfidentialRead is visible.
   9.275 -        /// </summary>
   9.276 -        public bool ToggleButtonKeepConfidentialRead_GetVisible(Office.IRibbonControl control)
   9.277 -        {
   9.278 -            return (true); // Unimplemented
   9.279 -        }
   9.280 -
   9.281 -        ///////////////////////////////////////////////////////////
   9.282 -        // Groups
   9.283 -        ///////////////////////////////////////////////////////////
   9.284 -
   9.285 -        /// <summary>
   9.286 -        /// Callback to get whether the GroupPEPReadMailMessage is visible.
   9.287 -        /// </summary>
   9.288 -        public bool GroupPEPReadMailMessage_GetVisible(Office.IRibbonControl control)
   9.289 -        {
   9.290 -            return (true); // Unimplemented
   9.291 -        }
   9.292 -
   9.293 +        
   9.294          /**************************************************************
   9.295           * 
   9.296           * Callbacks (Contact Inspector Ribbon)
   9.297 @@ -980,61 +863,15 @@
   9.298          }
   9.299  
   9.300          /// <summary>
   9.301 -        /// Event handler for when the ToggleButtonKeepConfidential is clicked.
   9.302 +        /// Event handler for when the ToggleButtonNeverUnsecure is clicked.
   9.303          /// </summary>
   9.304 -        public void ToggleButtonKeepConfidential_Click(Office.IRibbonControl control, bool isPressed)
   9.305 +        public void ToggleButtonNeverUnsecure_Click(Office.IRibbonControl control, bool isPressed)
   9.306          {
   9.307 -            this.SetProperty(EnumProperty.KeepConfidentialProperty, isPressed);
   9.308 +            this.SetProperty(EnumProperty.NeverUnsecureProperty, isPressed);
   9.309              this.ribbon.Invalidate();
   9.310              return;
   9.311          }
   9.312 -
   9.313 -        /// <summary>
   9.314 -        /// Event handler for when the ToggleButtonKeepConfidentialRead is clicked.
   9.315 -        /// </summary>
   9.316 -        public void ToggleButtonKeepConfidentialRead_Click(Office.IRibbonControl control, bool isPressed)
   9.317 -        {
   9.318 -            DialogResult result;
   9.319 -            CryptableMailItem cmi;
   9.320 -            Outlook.MailItem currMailItem = null;
   9.321 -            Outlook.Inspector insp = null;
   9.322 -
   9.323 -            // Ask the user to continue?
   9.324 -            result = MessageBox.Show(Properties.Resources.Message_NeedReopen,
   9.325 -                                     Properties.Resources.Message_TitleConfirmOperation,
   9.326 -                                     MessageBoxButtons.YesNo);
   9.327 -
   9.328 -            if (result == DialogResult.Yes)
   9.329 -            {
   9.330 -                insp = Globals.ThisAddIn.Application.ActiveInspector();
   9.331 -
   9.332 -                if ((insp != null) &&
   9.333 -                    (insp.CurrentItem != null) &&
   9.334 -                    (insp.CurrentItem is Outlook.MailItem))
   9.335 -                {
   9.336 -                    currMailItem = (Outlook.MailItem)insp.CurrentItem;
   9.337 -                    cmi = new CryptableMailItem(currMailItem);
   9.338 -
   9.339 -                    // Change the KeepConfidential property
   9.340 -                    cmi.KeepConfidential = isPressed;
   9.341 -
   9.342 -                    // Close the inspector, the next time the message is viewed it will be reprocessed correctly
   9.343 -                    ((Outlook._Inspector)insp).Close(Outlook.OlInspectorClose.olDiscard);
   9.344 -                    Marshal.ReleaseComObject(insp);
   9.345 -                    insp = null;
   9.346 -
   9.347 -                    /* Start re-processing the message
   9.348 -                     * Note: Make sure to dispose the MailItem after processing (pass true).
   9.349 -                     * Do NOT use omi or cmi references after this point!
   9.350 -                     */
   9.351 -                    cmi.StartProcessing(true);
   9.352 -                }
   9.353 -            }
   9.354 -
   9.355 -            this.ribbon.Invalidate();
   9.356 -            return;
   9.357 -        }
   9.358 -
   9.359 +        
   9.360          /// <summary>
   9.361          /// Event handler for when the ToggleButtonForceUnencryptedContact is clicked.
   9.362          /// </summary>
    10.1 --- a/UI/RibbonCustomizations.xml	Wed Aug 03 10:26:32 2016 +0200
    10.2 +++ b/UI/RibbonCustomizations.xml	Thu Aug 04 06:46:44 2016 -0700
    10.3 @@ -34,31 +34,15 @@
    10.4                          getSupertip="ToggleButtonAttachOwnKey_GetSupertip"
    10.5                          getVisible="ToggleButtonAttachOwnKey_GetVisible"
    10.6                          onAction="ToggleButtonAttachOwnKey_Click" />
    10.7 -          <toggleButton id="ToggleButtonKeepConfidential"
    10.8 +          <toggleButton id="ToggleButtonNeverUnsecure"
    10.9                          size="large"
   10.10 -                        getEnabled="ToggleButtonKeepConfidential_GetEnabled"
   10.11 -                        getImage="ToggleButtonKeepConfidential_GetImage"
   10.12 -                        getLabel="ToggleButtonKeepConfidential_GetLabel"
   10.13 -                        getPressed="ToggleButtonKeepConfidential_GetPressed"
   10.14 -                        getSupertip="ToggleButtonKeepConfidential_GetSupertip"
   10.15 -                        getVisible="ToggleButtonKeepConfidential_GetVisible"
   10.16 -                        onAction="ToggleButtonKeepConfidential_Click" />
   10.17 -        </group>
   10.18 -      </tab>
   10.19 -      <tab idMso="TabReadMessage">
   10.20 -        <group id="GroupPEPReadMailMessage"
   10.21 -               insertAfterMso="GroupMessageOptions"
   10.22 -               label="p≡p"
   10.23 -               getVisible="GroupPEPReadMailMessage_GetVisible">
   10.24 -          <toggleButton id="ToggleButtonKeepConfidentialRead"
   10.25 -                        size="large"
   10.26 -                        getEnabled="ToggleButtonKeepConfidentialRead_GetEnabled"
   10.27 -                        getImage="ToggleButtonKeepConfidentialRead_GetImage"
   10.28 -                        getLabel="ToggleButtonKeepConfidentialRead_GetLabel"
   10.29 -                        getPressed="ToggleButtonKeepConfidentialRead_GetPressed"
   10.30 -                        getSupertip="ToggleButtonKeepConfidentialRead_GetSupertip"
   10.31 -                        getVisible="ToggleButtonKeepConfidentialRead_GetVisible"
   10.32 -                        onAction="ToggleButtonKeepConfidentialRead_Click" />
   10.33 +                        getEnabled="ToggleButtonNeverUnsecure_GetEnabled"
   10.34 +                        getImage="ToggleButtonNeverUnsecure_GetImage"
   10.35 +                        getLabel="ToggleButtonNeverUnsecure_GetLabel"
   10.36 +                        getPressed="ToggleButtonNeverUnsecure_GetPressed"
   10.37 +                        getSupertip="ToggleButtonNeverUnsecure_GetSupertip"
   10.38 +                        getVisible="ToggleButtonNeverUnsecure_GetVisible"
   10.39 +                        onAction="ToggleButtonNeverUnsecure_Click" />
   10.40          </group>
   10.41        </tab>
   10.42        <tab idMso="TabContact">
    11.1 --- a/pEpForOutlook.csproj	Wed Aug 03 10:26:32 2016 +0200
    11.2 +++ b/pEpForOutlook.csproj	Thu Aug 04 06:46:44 2016 -0700
    11.3 @@ -462,8 +462,8 @@
    11.4      <WCFMetadata Include="Service References\" />
    11.5    </ItemGroup>
    11.6    <ItemGroup>
    11.7 -    <Resource Include="Resources\ImageKeepConfidentialOff.png" />
    11.8 -    <Resource Include="Resources\ImageKeepConfidentialOn.png" />
    11.9 +    <Resource Include="Resources\ImageNeverUnsecureOff.png" />
   11.10 +    <Resource Include="Resources\ImageNeverUnsecureOn.png" />
   11.11      <EmbeddedResource Include="UI\RibbonCustomizations.xml">
   11.12        <SubType>Designer</SubType>
   11.13      </EmbeddedResource>