Skip to content

Commit 4a60ae2

Browse files
authored
SignedXml: drop .NET 12 InvalidOperationException documentation (#13054)
The dotnet/runtime PR that would have thrown InvalidOperationException on SignedXml instance reuse in .NET 12 (dotnet/runtime#132836) has been closed and is not going to ship. Remove the 10 <exception cref="T:System.InvalidOperationException"> entries added across ComputeSignature, CheckSignature, CheckSignatureReturningKey, LoadXml, AddReference, and AddObject, and drop the .NET 12-specific sentence from the `Instances are single-use` remarks section. The general guidance that a SignedXml instance is not intended to be reused across multiple signing or verification operations remains correct and stays.
1 parent 3cc8752 commit 4a60ae2

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

xml/System.Security.Cryptography.Xml/SignedXml.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Given the risks of external references, <xref:System.Security.Cryptography.Xml.S
190190
191191
## Instances are single-use
192192
193-
A <xref:System.Security.Cryptography.Xml.SignedXml> instance is not intended to be reused across multiple signing or verification operations. Starting in .NET 12, calling <xref:System.Security.Cryptography.Xml.SignedXml.ComputeSignature*> or <xref:System.Security.Cryptography.Xml.SignedXml.CheckSignature*> more than once on the same instance, or calling <xref:System.Security.Cryptography.Xml.SignedXml.LoadXml*>, <xref:System.Security.Cryptography.Xml.SignedXml.AddReference*>, or <xref:System.Security.Cryptography.Xml.SignedXml.AddObject*> after a call to <xref:System.Security.Cryptography.Xml.SignedXml.ComputeSignature*> or <xref:System.Security.Cryptography.Xml.SignedXml.CheckSignature*> has begun on the same instance, throws <xref:System.InvalidOperationException>. This applies even if the earlier call itself threw an exception. Create a new <xref:System.Security.Cryptography.Xml.SignedXml> instance for each signing or verification operation.
193+
A <xref:System.Security.Cryptography.Xml.SignedXml> instance is not intended to be reused across multiple signing or verification operations. Reusing an instance can produce incorrect results. Create a new <xref:System.Security.Cryptography.Xml.SignedXml> instance for each signing or verification operation.
194194
195195
]]></format>
196196
</remarks>
@@ -447,7 +447,6 @@ The following code example shows how to sign and verify a single element of an X
447447
448448
]]></format>
449449
</remarks>
450-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
451450
</Docs>
452451
</Member>
453452
<Member MemberName="AddReference">
@@ -515,7 +514,6 @@ The following code example shows how to sign and verify a single element of an X
515514
516515
]]></format>
517516
</remarks>
518-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
519517
</Docs>
520518
</Member>
521519
<MemberGroup MemberName="CheckSignature">
@@ -608,7 +606,6 @@ The following code example shows how to sign and verify a single element of an X
608606
-or
609607

610608
The hash algorithm could not be created.</exception>
611-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
612609
</Docs>
613610
</Member>
614611
<Member MemberName="CheckSignature">
@@ -674,7 +671,6 @@ The following code example shows how to sign and verify a single element of an X
674671
-or
675672

676673
The hash algorithm could not be created.</exception>
677-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
678674
</Docs>
679675
</Member>
680676
<Member MemberName="CheckSignature">
@@ -740,7 +736,6 @@ The following code example shows how to sign and verify a single element of an X
740736
-or-
741737

742738
The cryptographic transform used to check the signature could not be created.</exception>
743-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
744739
</Docs>
745740
</Member>
746741
<Member MemberName="CheckSignature">
@@ -803,7 +798,6 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
803798
</remarks>
804799
<exception cref="T:System.ArgumentNullException">The <paramref name="certificate" /> parameter is <see langword="null" />.</exception>
805800
<exception cref="T:System.Security.Cryptography.CryptographicException">A signature description could not be created for the <paramref name="certificate" /> parameter.</exception>
806-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
807801
</Docs>
808802
</Member>
809803
<Member MemberName="CheckSignatureReturningKey">
@@ -877,7 +871,6 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
877871
-or
878872

879873
The hash algorithm could not be created.</exception>
880-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
881874
</Docs>
882875
</Member>
883876
<MemberGroup MemberName="ComputeSignature">
@@ -955,7 +948,6 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
955948
-or-
956949

957950
The key could not be loaded.</exception>
958-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
959951
</Docs>
960952
</Member>
961953
<Member MemberName="ComputeSignature">
@@ -1026,7 +1018,6 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
10261018
-or-
10271019

10281020
The cryptographic transform used to check the signature could not be created.</exception>
1029-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
10301021
</Docs>
10311022
</Member>
10321023
<Member MemberName="EncryptedXml">
@@ -1331,7 +1322,6 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
13311322
-or-
13321323

13331324
The <paramref name="value" /> parameter does not contain a valid <see cref="P:System.Security.Cryptography.Xml.SignedXml.SignedInfo" /> property.</exception>
1334-
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Security.Cryptography.Xml.SignedXml" /> instance has already been used to compute or verify a signature.</exception>
13351325
</Docs>
13361326
</Member>
13371327
<Member MemberName="m_signature">
@@ -3060,4 +3050,3 @@ The X.509 certificate is verified. The <xref:System.Security.Cryptography.Xml.Si
30603050
</Member>
30613051
</Members>
30623052
</Type>
3063-

0 commit comments

Comments
 (0)