@@ -32,7 +32,47 @@ public WireEncryptedString(SerializationInfo info, StreamingContext context)
32
32
/// <summary>
33
33
/// The encrypted value of this string
34
34
/// </summary>
35
- public EncryptedValue EncryptedValue { get ; set ; }
35
+ public EncryptedValue EncryptedValue
36
+ {
37
+ get
38
+ {
39
+ if ( encryptedValue != null )
40
+ return encryptedValue ;
41
+
42
+ if ( EncryptedBase64Value != null )
43
+ return new EncryptedValue
44
+ {
45
+ EncryptedBase64Value = EncryptedBase64Value ,
46
+ Base64Iv = Base64Iv
47
+ } ;
48
+ return null ;
49
+ }
50
+ set
51
+ {
52
+ encryptedValue = value ;
53
+
54
+ if ( encryptedValue != null )
55
+ {
56
+ EncryptedBase64Value = encryptedValue . EncryptedBase64Value ;
57
+ Base64Iv = encryptedValue . Base64Iv ;
58
+ }
59
+ }
60
+ }
61
+ EncryptedValue encryptedValue ;
62
+
63
+ //**** we need to duplicate to make versions > 3.2.7 backwards compatible with 2.X
64
+
65
+ /// <summary>
66
+ /// Only keept for backwards compatibility reasons
67
+ /// </summary>
68
+ public string EncryptedBase64Value { get ; set ; }
69
+
70
+ /// <summary>
71
+ /// Only keept for backwards compatibility reasons
72
+ /// </summary>
73
+ public string Base64Iv { get ; set ; }
74
+
75
+ //****
36
76
37
77
/// <summary>
38
78
/// Gets the string value from the WireEncryptedString.
@@ -61,7 +101,7 @@ public static implicit operator WireEncryptedString(string s)
61
101
/// <param name="context"></param>
62
102
public void GetObjectData ( SerializationInfo info , StreamingContext context )
63
103
{
64
- info . AddValue ( "EncryptedValue" , EncryptedValue ) ;
104
+ info . AddValue ( "EncryptedValue" , EncryptedValue ) ;
65
105
}
66
106
}
67
107
0 commit comments