You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Document Pkcs12Info
* fixed bad tag
* Update Pkcs12Info.xml
* Apply suggestions from code review
Co-Authored-By: Ron Petrusha <[email protected]>
* Remove erroneous 12s, add a remarks to the new VerifyWithMac MemberGroup
* Fixed broken xref.
* Added <Docs> element
* Apply more feedback
<summary>Gets a read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</summary>
40
+
<value>A read-only collection of the SafeContents values present in the PFX AuthenticatedSafe.</value>
41
41
<remarks>To be added.</remarks>
42
42
</Docs>
43
43
</Member>
@@ -62,12 +62,25 @@
62
62
<ParameterName="skipCopy"Type="System.Boolean" />
63
63
</Parameters>
64
64
<Docs>
65
-
<paramname="encodedBytes">To be added.</param>
66
-
<paramname="bytesConsumed">To be added.</param>
67
-
<paramname="skipCopy">To be added.</param>
68
-
<summary>To be added.</summary>
69
-
<returns>To be added.</returns>
70
-
<remarks>To be added.</remarks>
65
+
<paramname="encodedBytes">The data to interpret as a PKCS#12 PFX.</param>
66
+
<paramname="bytesConsumed">When this method returns, contains a value that indicates the number of bytes from <paramrefname="encodedBytes"/> which were read by this method. This parameter is treated as uninitialized.</param>
67
+
<paramname="skipCopy"><seelangword="true"/> to store <paramrefname="encodedBytes"/> without making a defensive copy; otherwise, <seelangword="false"/>. The default is <seelangword="false"/>.</param>
68
+
<summary>Reads the provided data as a PKCS#12 PFX and returns an object view of the contents.</summary>
69
+
<returns>An object view of the PKCS#12 PFX decoded from the input.</returns>
70
+
<remarks>
71
+
<formattype="text/markdown"><![CDATA[
72
+
73
+
## Remarks
74
+
75
+
The default behavior of this method is to make a defensive copy of the first `bytesConsumed` bytes from `encodedBytes`.
76
+
When the `skipCopy` parameter is `true`, this defensive copy is skipped.
77
+
If the defensive copy is skipped and the contents of the first `bytesConsumed` bytes of `encodedBytes` change during the lifetime of the returned value or of any object produced by its
78
+
methods or properties, then methods and properties on those objects may produce nonsense results or throw exceptions due to the corrupted state.
79
+
Callers are therefore advised to only use a `true` value for the `skipCopy` parameter when they can be reasonably assured that the data will stay intact.
80
+
81
+
]]></format>
82
+
</remarks>
83
+
<exceptioncref="T:System.Security.Cryptography.CryptographicException">The contents of the <paramrefname="encodedBytes"/> parameter were not successfully decoded as a PKCS#12 PFX.</exception>
<summary>Gets a value that indicates the type of tamper protection provided for the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents.</summary>
104
+
<value>One of the enumeration members that indicates the type of tamper protection provided for the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents.</value>
<summary>Attempts to verify the integrity of the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe" /> contents with a password.</summary>
116
+
<remarks>
117
+
<formattype="text/markdown"><![CDATA[
118
+
119
+
## Remarks
120
+
It's not possible to distinguish the error due to the password being incorrect from the error due to the contents having been altered.
121
+
122
+
It's usually the case that a password-protected PFX uses the same password for the MAC algorithm providing integrity and the encryption algorithm providing confidentiality,
123
+
but the file format doesn't make that a requirement.
124
+
Therefore, there is no guarantee that a password which results in a `true` return from this method will succeed on a call to <xref:System.Security.Cryptography.Pkcs.Pkcs12SafeContents.Decrypt%2A>.
<paramname="password">The password to use to attempt to verify integrity.</param>
151
+
<summary>Attempts to verify the integrity of the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents with a password represented by a <seecref="T:System.ReadOnlySpan{System.Char}"/>.</summary>
152
+
<returns><seelangword="true"/> if the password successfully verifies the integrity of the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents; <seelangword="false"/> if the password is not correct or the contents have been altered.</returns>
153
+
<remarks>
154
+
<formattype="text/markdown"><![CDATA[
155
+
156
+
## Remarks
157
+
158
+
In the PKCS#12 specification, a distinction is made between a `null` password and an "empty" password, and that difference is reflected in the return value of this method.
159
+
`ReadOnlySpan<Char>.Empty` represents the `null` password and `String.Empty.AsSpan()` represents the "empty" password. If one of those two values returns `true`, the other won't.
160
+
161
+
]]></format>
162
+
</remarks>
163
+
<exceptioncref="T:System.InvalidOperationException">The <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode"/> value is not <seecref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password"/>.</exception>
164
+
<exceptioncref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
119
165
</Docs>
120
166
</Member>
121
167
<MemberMemberName="VerifyMac">
@@ -138,11 +184,22 @@
138
184
<ParameterName="password"Type="System.String" />
139
185
</Parameters>
140
186
<Docs>
141
-
<paramname="password">To be added.</param>
142
-
<summary>To be added.</summary>
143
-
<returns>To be added.</returns>
144
-
<remarks>To be added.</remarks>
187
+
<paramname="password">The password to use to attempt to verify integrity.</param>
188
+
<summary>Attempts to verify the integrity of the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents with a password represented by a <seecref="T:System.String"/>.</summary>
189
+
<returns><seelangword="true"/> if the password successfully verifies the integrity of the <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.AuthenticatedSafe"/> contents; <seelangword="false"/> if the password is not correct or the contents have been altered.</returns>
190
+
<remarks>
191
+
<formattype="text/markdown"><![CDATA[
192
+
193
+
## Remarks
194
+
195
+
In the PKCS#12 specification, a distinction is made between a `null` password and an "empty" password, and that difference is reflected in the return value of this method.
196
+
If the `null` string returns `true`, then <xref:System.String.Empty?displayProperty=nameWithType> returns `false`, and vice versa.
197
+
198
+
]]></format>
199
+
</remarks>
200
+
<exceptioncref="T:System.InvalidOperationException">The <seecref="P:System.Security.Cryptography.Pkcs.Pkcs12Info.IntegrityMode"/> value is not <seecref="F:System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode.Password"/>.</exception>
201
+
<exceptioncref="T:System.Security.Cryptography.CryptographicException">The hash algorithm option specified by the PKCS#12 PFX contents could not be identified or is not supported by this platform.</exception>
0 commit comments