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
Add documentation for the rest of the Pkcs12SafeBag derived types (#2926)
* Add documentation for the rest of the Pkcs12SafeBag derived types
* Apply suggestions from code review
Co-Authored-By: Ron Petrusha <[email protected]>
<paramname="skipCopy"><seelangword="true"/> to store <paramrefname="pkcs8PrivateKey"/> without making a defensive copy; otherwise, <seelangword="false"/>. The default is <seelangword="false"/>.</param>
41
+
<summary>Initializes a new instance of the <seecref="T:System.Security.Cryptography.Pkcs.Pkcs12KeyBag"/> from an existing encoded PKCS#8 PrivateKeyInfo value.</summary>
42
+
<remarks>
43
+
<formattype="text/markdown"><![CDATA[
44
+
45
+
## Remarks
46
+
47
+
This method validates that `pkcs8PrivateKey` is a single BER-encoded value, but it does not verify that the value is a proper PKCS#8 PrivateKeyInfo value.
48
+
49
+
Transporting private keys in a KeyBag is permitted by the PKCS#12 standard, but not all PFX readers support pairing certificates with keys from a KeyBag.
50
+
For best support, transport keys in a ShroudedKeyBag (<xref:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag>).
51
+
52
+
The default behavior of this method is to make a defensive copy of `pkcs8PrivateKey`.
53
+
When the `skipCopy` parameter is `true`, this defensive copy is skipped.
54
+
If the defensive copy is skipped and the contents of `pkcs8PrivateKey` change during the lifetime of the returned value or of any object produced by its
55
+
methods or properties, then methods and properties on those objects may produce nonsense results or throw exceptions due to the corrupted state.
56
+
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.
57
+
58
+
]]></format>
59
+
</remarks>
60
+
<exceptioncref="T:System.Security.Cryptography.CryptographicException">The <paramrefname="pkcs8privateKey"/> parameter does not represent a single ASN.1 BER-encoded value.</exception>
Copy file name to clipboardExpand all lines: xml/System.Security.Cryptography.Pkcs/Pkcs12SafeContentsBag.xml
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,9 @@
15
15
</Base>
16
16
<Interfaces />
17
17
<Docs>
18
-
<summary>To be added.</summary>
18
+
<summary>Represents the SafeContentsBag from PKCS#12, a container whose contents are a PKCS#12 SafeContents value. This class cannot be inherited.</summary>
Copy file name to clipboardExpand all lines: xml/System.Security.Cryptography.Pkcs/Pkcs12SecretBag.xml
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
</Base>
16
16
<Interfaces />
17
17
<Docs>
18
-
<summary>To be added.</summary>
18
+
<summary>Represents the SecretBag from PKCS#12, a container whose contents are arbitrary data with a type identifier. This class cannot be inherited.</summary>
19
19
<remarks>To be added.</remarks>
20
20
</Docs>
21
21
<Members>
@@ -37,9 +37,10 @@
37
37
</ReturnValue>
38
38
<Parameters />
39
39
<Docs>
40
-
<summary>To be added.</summary>
41
-
<returns>To be added.</returns>
40
+
<summary>Gets the Object Identifier (OID) which identifies the data type of the secret value.</summary>
41
+
<returns>The Object Identifier (OID) which identifies the data type of the secret value.</returns>
Copy file name to clipboardExpand all lines: xml/System.Security.Cryptography.Pkcs/Pkcs12ShroudedKeyBag.xml
+35-9Lines changed: 35 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
</Base>
16
16
<Interfaces />
17
17
<Docs>
18
-
<summary>To be added.</summary>
18
+
<summary>Represents the ShroudedKeyBag from PKCS#12, a container whose contents are a PKCS#8 EncryptedPrivateKeyInfo. This class cannot be inherited.</summary>
19
19
<remarks>To be added.</remarks>
20
20
</Docs>
21
21
<Members>
@@ -36,10 +36,26 @@
36
36
<ParameterName="skipCopy"Type="System.Boolean" />
37
37
</Parameters>
38
38
<Docs>
39
-
<paramname="encryptedPkcs8PrivateKey">To be added.</param>
<paramname="skipCopy"><seelangword="true"/> to store <paramrefname="encryptedPkcs8PrivateKey"/> without making a defensive copy; otherwise, <seelangword="false"/>. The default is <seelangword="false"/>.</param>
41
+
<summary>Initializes a new instance of the <seecref="T:System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag"/> from an existing encoded PKCS#8 EncryptedPrivateKeyInfo value.</summary>
42
+
<remarks>
43
+
<formattype="text/markdown"><![CDATA[
44
+
45
+
## Remarks
46
+
47
+
This method validates that `encryptedPkcs8PrivateKey` is a single BER-encoded value, but it does not verify that the value is a proper PKCS#8 EncryptedPrivateKeyInfo value.
48
+
49
+
The default behavior of this method is to make a defensive copy of `encryptedPkcs8PrivateKey`.
50
+
When the `skipCopy` parameter is `true`, this defensive copy is skipped.
51
+
If the defensive copy is skipped and the contents of `encryptedPkcs8PrivateKey` change during the lifetime of the returned value or of any object produced by its
52
+
methods or properties, then methods and properties on those objects may produce nonsense results or throw exceptions due to the corrupted state.
53
+
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.
54
+
55
+
]]></format>
56
+
</remarks>
57
+
<exceptioncref="T:System.Security.Cryptography.CryptographicException">The <paramrefname="encryptedPkcs8privateKey"/> parameter does not represent a single ASN.1 BER-encoded value.</exception>
0 commit comments