Skip to content

Commit b44eb2b

Browse files
bartonjsRon Petrusha
andcommitted
Add remaining documentation for Pkcs12CertBag (#2925)
* Add remaining documentation for Pkcs12CertBag * Apply suggestions from code review Co-Authored-By: Ron Petrusha <[email protected]>
1 parent c4ad828 commit b44eb2b

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

xml/System.Security.Cryptography.Pkcs/Pkcs12CertBag.xml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</Base>
1616
<Interfaces />
1717
<Docs>
18-
<summary>To be added.</summary>
18+
<summary>Represents the PKCS#12 CertBag. This class cannot be inherited.</summary>
1919
<remarks>To be added.</remarks>
2020
</Docs>
2121
<Members>
@@ -43,12 +43,16 @@
4343
<remarks>
4444
<format type="text/markdown"><![CDATA[
4545
46+
## Remarks
47+
4648
No validation is done to ensure that the `encodedCertificate` value is correct for the indicated `certificateType`.
4749
4850
Note that for X.509 public-key certificates, the correct encoding for a CertBag value is to wrap the DER-encoded certificate in an OCTET STRING.
4951
5052
]]></format>
5153
</remarks>
54+
<exception cref="T:System.ArgumentNullException">The <paramref name="certificateType"/> parameter is <see langword="null"/>.</exception>
55+
<exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="encodedCertificate"/> parameter does not represent a single ASN.1 BER-encoded value.</exception>
5256
</Docs>
5357
</Member>
5458
<Member MemberName="EncodedCertificate">
@@ -68,9 +72,18 @@ Note that for X.509 public-key certificates, the correct encoding for a CertBag
6872
<ReturnType>System.ReadOnlyMemory&lt;System.Byte&gt;</ReturnType>
6973
</ReturnValue>
7074
<Docs>
71-
<summary>To be added.</summary>
72-
<value>To be added.</value>
73-
<remarks>To be added.</remarks>
75+
<summary>Gets the uninterpreted certificate contents of the CertSafeBag.</summary>
76+
<value>The uninterpreted certificate contents of the CertSafeBag.</value>
77+
<remarks>
78+
<format type="text/markdown"><![CDATA[
79+
80+
## Remarks
81+
82+
For X.509 public-key certificates, the value of this property is a BER-encoded OCTET STRING value encompassing the certificate's DER encoded value.
83+
84+
]]></format>
85+
</remarks>
86+
<altmember cref="M:System.Security.Cryptography.Pkcs.Pkcs12CertBag.GetCertificate"/>
7487
</Docs>
7588
</Member>
7689
<Member MemberName="GetCertificate">
@@ -91,9 +104,12 @@ Note that for X.509 public-key certificates, the correct encoding for a CertBag
91104
</ReturnValue>
92105
<Parameters />
93106
<Docs>
94-
<summary>To be added.</summary>
95-
<returns>To be added.</returns>
107+
<summary>Gets the contents of the CertBag interpreted as an X.509 public key certificate.</summary>
108+
<returns>A certificate decoded from the contents of the CertBag.</returns>
96109
<remarks>To be added.</remarks>
110+
<exception cref="T:System.InalidOperationException">The content type is not the X.509 public key certificate content type.</exception>
111+
<exception cref="T:System.Security.Cryptography.CryptographicException">The contents were not valid for the X.509 certificate content type.</exception>
112+
<altmember cref="P:System.Security.Cryptography.Pkcs.Pkcs12CertBag.IsX509Certificate"/>
97113
</Docs>
98114
</Member>
99115
<Member MemberName="GetCertificateType">
@@ -114,9 +130,18 @@ Note that for X.509 public-key certificates, the correct encoding for a CertBag
114130
</ReturnValue>
115131
<Parameters />
116132
<Docs>
117-
<summary>To be added.</summary>
118-
<returns>To be added.</returns>
119-
<remarks>To be added.</remarks>
133+
<summary>Gets the Object Identifier (OID) which identifies the content type of the encoded certificte value.</summary>
134+
<returns>The Object Identifier (OID) which identifies the content type of the encoded certificate value.</returns>
135+
<remarks>
136+
<format type="text/markdown"><![CDATA[
137+
138+
## Remarks
139+
140+
IETF RFC 7292 defines two content types for a CertBag: X.509 Public Key Certificate (1.2.840.113549.1.9.22.1) and SDSI Certificate (1.2.840.113549.1.9.22.2), as well as indicating other types could be added in the future. This type has special support for X.509 Public Key Certificates, which are represented in .NET by the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> class, via the <xref:System.Security.Cryptography.Pkcs.Pkcs12CertBag.IsX509Certificate> and <xref:System.Security.Cryptography.Pkcs.Pkcs12CertBag.GetCertificate> members. This type does not have special support for SDSI certificates, but callers expecting an SDSI certificate (or a certificate type defined after IETF RFC 7292) can process the value directly via the <xref:System.Security.Cryptography.Pkcs.Pkcs12CertBag.EncodedCertificate> property.
141+
142+
]]></format>
143+
</remarks>
144+
<altmember cref="P:System.Security.Cryptography.Pkcs.Pkcs12CertBag.IsX509Certificate"/>
120145
</Docs>
121146
</Member>
122147
<Member MemberName="IsX509Certificate">
@@ -136,10 +161,11 @@ Note that for X.509 public-key certificates, the correct encoding for a CertBag
136161
<ReturnType>System.Boolean</ReturnType>
137162
</ReturnValue>
138163
<Docs>
139-
<summary>To be added.</summary>
140-
<value>To be added.</value>
164+
<summary>Gets a value indicating whether the content type of the encoded certificate value is the X.509 public key certificate content type.</summary>
165+
<value><see langword="true"/> if the content type is the X.509 public key certificate content type (1.2.840.113549.1.9.22.1); otherwise, <see langword="false"/>.</value>
141166
<remarks>To be added.</remarks>
167+
<altmember cref="M:System.Security.Cryptography.Pkcs.Pkcs12CertBag.GetCertificateType"/>
142168
</Docs>
143169
</Member>
144170
</Members>
145-
</Type>
171+
</Type>

0 commit comments

Comments
 (0)