Skip to content

Commit 5b4df44

Browse files
authored
Add missing documentation for S.S.Cryptography (#4892)
* Add missing documentation for S.S.Cryptography * Apply feedback
1 parent 7797330 commit 5b4df44

File tree

4 files changed

+43
-23
lines changed

4 files changed

+43
-23
lines changed

xml/System.Security.Cryptography.Pkcs/ContentInfo.xml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,12 @@
283283
<Parameter Name="encodedMessage" Type="System.Byte[]" />
284284
</Parameters>
285285
<Docs>
286-
<param name="encodedMessage">An array of byte values that represents the encoded <see cref="T:System.Security.Cryptography.Pkcs.ContentInfo" /> message from which to retrieve the outer content type.</param>
287-
<summary>The <see cref="M:System.Security.Cryptography.Pkcs.ContentInfo.GetContentType(System.Byte[])" /> static method retrieves the outer content type of the encoded <see cref="T:System.Security.Cryptography.Pkcs.ContentInfo" /> message represented by an array of byte values.</summary>
288-
<returns>If the method succeeds, the method returns an <see cref="T:System.Security.Cryptography.Oid" /> object that contains the outer content type of the specified encoded <see cref="T:System.Security.Cryptography.Pkcs.ContentInfo" /> message.
289-
290-
If the method fails, it throws an exception.</returns>
286+
<param name="encodedMessage">An array of byte values that represents the encoded CMS ContentInfo message from which to retrieve the outer content type.</param>
287+
<summary>Retrieves the outer content type of an encoded CMS ContentInfo message.</summary>
288+
<returns>The outer content type of the specified encoded CMS ContentInfo message.</returns>
291289
<remarks>To be added.</remarks>
292-
<exception cref="T:System.ArgumentNullException">A null reference was passed to a method that does not accept it as a valid argument.</exception>
293-
<exception cref="T:System.Security.Cryptography.CryptographicException">An error occurred during a cryptographic operation.</exception>
290+
<exception cref="T:System.ArgumentNullException"><paramref name="encodedMessage" /> is <see langword="null" />.</exception>
291+
<exception cref="T:System.Security.Cryptography.CryptographicException"><paramref name="encodedMessage" /> cannot be decoded as a valid CMS ContentInfo value.</exception>
294292
</Docs>
295293
</Member>
296294
<Member MemberName="GetContentType">
@@ -312,10 +310,11 @@
312310
<Parameter Name="encodedMessage" Type="System.ReadOnlySpan&lt;System.Byte&gt;" Index="0" FrameworkAlternate="dotnet-plat-ext-5.0;net-5.0" />
313311
</Parameters>
314312
<Docs>
315-
<param name="encodedMessage">To be added.</param>
316-
<summary>To be added.</summary>
317-
<returns>To be added.</returns>
313+
<param name="encodedMessage">A read-only span of byte values that represents the encoded CMS ContentInfo message from which to retrieve the outer content type.</param>
314+
<summary>Retrieves the outer content type of an encoded CMS ContentInfo message.</summary>
315+
<returns>The outer content type of the specified encoded CMS ContentInfo message.</returns>
318316
<remarks>To be added.</remarks>
317+
<exception cref="T:System.Security.Cryptography.CryptographicException"><paramref name="encodedMessage" /> cannot be decoded as a valid CMS ContentInfo value.</exception>
319318
</Docs>
320319
</Member>
321320
</Members>

xml/System.Security.Cryptography.Pkcs/SignedCms.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ The following permissions are required to access the signature key:
844844
<Parameter Name="encodedMessage" Type="System.Byte[]" />
845845
</Parameters>
846846
<Docs>
847-
<param name="encodedMessage">Array of byte values that represents the encoded CMS/PKCS #7 message to be decoded.</param>
848-
<summary>The <see cref="M:System.Security.Cryptography.Pkcs.SignedCms.Decode(System.Byte[])" /> method decodes an encoded <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> message. Upon successful decoding, the decoded information can be retrieved from the properties of the <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> object.</summary>
847+
<param name="encodedMessage">An array of byte values that represents the encoded CMS/PKCS#7 message to be decoded.</param>
848+
<summary>Decodes an encoded <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> message.</summary>
849849
<remarks>
850850
<format type="text/markdown"><![CDATA[
851851
@@ -867,8 +867,8 @@ The following permissions are required to access the signature key:
867867
868868
]]></format>
869869
</remarks>
870-
<exception cref="T:System.ArgumentNullException">A null reference was passed to a method that does not accept it as a valid argument.</exception>
871-
<exception cref="T:System.Security.Cryptography.CryptographicException">A cryptographic operation could not be completed.</exception>
870+
<exception cref="T:System.ArgumentNullException"><paramref name="encodedMessage" /> is <see langword="null" />.</exception>
871+
<exception cref="T:System.Security.Cryptography.CryptographicException"><paramref name="encodedMessage" /> could not be decoded successfully.</exception>
872872
<altmember cref="M:System.Security.Cryptography.Pkcs.SignedCms.Encode" />
873873
</Docs>
874874
</Member>
@@ -891,9 +891,12 @@ The following permissions are required to access the signature key:
891891
<Parameter Name="encodedMessage" Type="System.ReadOnlySpan&lt;System.Byte&gt;" Index="0" FrameworkAlternate="dotnet-plat-ext-5.0;net-5.0" />
892892
</Parameters>
893893
<Docs>
894-
<param name="encodedMessage">To be added.</param>
895894
<summary>To be added.</summary>
895+
<param name="encodedMessage">A read-only span of byte values that represents the encoded CMS/PKCS#7 message to be decoded.</param>
896+
<summary>Decodes an encoded <see cref="T:System.Security.Cryptography.Pkcs.SignedCms" /> message.</summary>
896897
<remarks>To be added.</remarks>
898+
<exception cref="T:System.Security.Cryptography.CryptographicException"><paramref name="encodedMessage" /> could not be decoded successfully.</exception>
899+
<altmember cref="M:System.Security.Cryptography.Pkcs.SignedCms.Encode" />
897900
</Docs>
898901
</Member>
899902
<Member MemberName="Detached">

xml/System.Security.Cryptography.X509Certificates/X509Certificate2.xml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -819,11 +819,28 @@
819819
<Parameter Name="keyStorageFlags" Type="System.Security.Cryptography.X509Certificates.X509KeyStorageFlags" Index="2" FrameworkAlternate="net-5.0" />
820820
</Parameters>
821821
<Docs>
822-
<param name="fileName">To be added.</param>
823-
<param name="password">To be added.</param>
824-
<param name="keyStorageFlags">To be added.</param>
825-
<summary>To be added.</summary>
826-
<remarks>To be added.</remarks>
822+
<param name="fileName">The name of a certificate file.</param>
823+
<param name="password">The password required to access the X.509 certificate data.</param>
824+
<param name="keyStorageFlags">A bitwise combination of the enumeration values that control where and how to import the certificate.</param>
825+
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509Certificate2" /> class using a certificate file name, a password, and a key storage flag.</summary>
826+
<remarks>
827+
<format type="text/markdown"><![CDATA[
828+
829+
## Remarks
830+
> [!IMPORTANT]
831+
> Never hard code a password within your source code. Hard-coded passwords can be retrieved from an assembly using the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler), a hex editor, or by simply opening up the assembly in a text editor such as Notepad.exe.
832+
833+
If you create an <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> certificate by specifying a PKCS7 signed file store for `fileName`, the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2> is created for the certificate that signed the store rather than for any of the certificates within the store.
834+
835+
]]></format>
836+
</remarks>
837+
<exception cref="T:System.Security.Cryptography.CryptographicException">An error with the certificate occurs. For example:
838+
839+
- The certificate file does not exist.
840+
841+
- The certificate is invalid.
842+
843+
- The certificate's password is incorrect.</exception>
827844
</Docs>
828845
</Member>
829846
<Member MemberName=".ctor">

xml/System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@
168168
<Parameter Name="critical" Type="System.Boolean" Index="1" FrameworkAlternate="net-5.0" />
169169
</Parameters>
170170
<Docs>
171-
<param name="subjectKeyIdentifier">To be added.</param>
172-
<param name="critical">To be added.</param>
173-
<summary>To be added.</summary>
171+
<param name="subjectKeyIdentifier">A read-only span of bytes that represents data to use to create the extension.</param>
172+
<param name="critical">
173+
<see langword="true" /> if the extension is critical; otherwise, <see langword="false" />.</param>
174+
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension" /> class using a read-only span of bytes and a value that identifies whether the extension is critical.</summary>
174175
<remarks>To be added.</remarks>
175176
</Docs>
176177
</Member>

0 commit comments

Comments
 (0)