-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
RSAKeyValue.xml
297 lines (272 loc) · 17.8 KB
/
RSAKeyValue.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<Type Name="RSAKeyValue" FullName="System.Security.Cryptography.Xml.RSAKeyValue">
<TypeSignature Language="C#" Value="public class RSAKeyValue : System.Security.Cryptography.Xml.KeyInfoClause" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit RSAKeyValue extends System.Security.Cryptography.Xml.KeyInfoClause" />
<TypeSignature Language="DocId" Value="T:System.Security.Cryptography.Xml.RSAKeyValue" />
<TypeSignature Language="VB.NET" Value="Public Class RSAKeyValue
Inherits KeyInfoClause" />
<TypeSignature Language="F#" Value="type RSAKeyValue = class
 inherit KeyInfoClause" />
<TypeSignature Language="C++ CLI" Value="public ref class RSAKeyValue : System::Security::Cryptography::Xml::KeyInfoClause" />
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.Security.Cryptography.Xml" FromVersion="9.0.0.0" To="System.Security" ToVersion="4.0.0.0" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Security.Cryptography.Xml.KeyInfoClause</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-8.0;net-9.0;windowsdesktop-8.0;windowsdesktop-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents the <<see langword="RSAKeyValue" />> element of an XML signature.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Security.Cryptography.Xml.RSAKeyValue> class represents the `<RSAKeyValue>` element of an XML signature defined by the XML digital signature specification. The `<RSAKeyValue>` element is the subelement of the `<KeyInfo>` element (represented by the <xref:System.Security.Cryptography.Xml.KeyInfo> class) that describes an <xref:System.Security.Cryptography.RSA> public key. The `<RSAKeyValue>` element contains the public key that corresponds to the private key used to digitally sign a document. A recipient of the document uses the public key to validate the XML signature.
Use the <xref:System.Security.Cryptography.Xml.RSAKeyValue> class whenever you want to add a public key to your XML digital signature.
If a key is not explicitly supplied to the constructor, a new <xref:System.Security.Cryptography.RSA> key pair is randomly generated.
For more information about the `<RSAKeyValue>` element, see the [W3C specification](https://www.w3.org/TR/xmldsig-core/).
## Examples
The following code example demonstrates how to generate and verify an enveloped XML signature using the <xref:System.Security.Cryptography.Xml.RSAKeyValue> object.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigEnvelope/CPP/xmldsigenv.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Security.Cryptography.Xml/KeyInfo/Overview/xmldsigenv.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigEnvelope/VB/xmldsigenv.vb" id="Snippet1":::
The following code example demonstrates how to generate and verify a detached XML signature using the <xref:System.Security.Cryptography.Xml.RSAKeyValue> object.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigDetached/CPP/xmldsigdetach.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Security.Cryptography.Xml/KeyInfo/Overview/xmldsigdetach.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigDetached/VB/xmldsigdetach.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Xml.RSAKeyValue" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public RSAKeyValue ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.Xml.RSAKeyValue.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 RSAKeyValue();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Xml.RSAKeyValue" /> class with a new randomly generated <see cref="T:System.Security.Cryptography.RSA" /> public key.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor creates a new instance of the default implementation of <xref:System.Security.Cryptography.RSA> to hold the public key.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public RSAKeyValue (System.Security.Cryptography.RSA key);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Security.Cryptography.RSA key) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.Xml.RSAKeyValue.#ctor(System.Security.Cryptography.RSA)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (key As RSA)" />
<MemberSignature Language="F#" Value="new System.Security.Cryptography.Xml.RSAKeyValue : System.Security.Cryptography.RSA -> System.Security.Cryptography.Xml.RSAKeyValue" Usage="new System.Security.Cryptography.Xml.RSAKeyValue key" />
<MemberSignature Language="C++ CLI" Value="public:
 RSAKeyValue(System::Security::Cryptography::RSA ^ key);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="key" Type="System.Security.Cryptography.RSA" />
</Parameters>
<Docs>
<param name="key">The instance of an implementation of <see cref="T:System.Security.Cryptography.RSA" /> that holds the public key.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.Xml.RSAKeyValue" /> class with the specified <see cref="T:System.Security.Cryptography.RSA" /> public key.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example demonstrates how to generate and verify an enveloped XML signature using the <xref:System.Security.Cryptography.Xml.RSAKeyValue> object.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigEnvelope/CPP/xmldsigenv.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Security.Cryptography.Xml/KeyInfo/Overview/xmldsigenv.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigEnvelope/VB/xmldsigenv.vb" id="Snippet1":::
The following code example demonstrates how to generate and verify a detached XML signature using the <xref:System.Security.Cryptography.Xml.RSAKeyValue> object.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigDetached/CPP/xmldsigdetach.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Security.Cryptography.Xml/KeyInfo/Overview/xmldsigdetach.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Cryptography.XML-XMLDsigDetached/VB/xmldsigdetach.vb" id="Snippet1":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetXml">
<MemberSignature Language="C#" Value="public override System.Xml.XmlElement GetXml ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Xml.XmlElement GetXml() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.Xml.RSAKeyValue.GetXml" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetXml () As XmlElement" />
<MemberSignature Language="F#" Value="override this.GetXml : unit -> System.Xml.XmlElement" Usage="rSAKeyValue.GetXml " />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Xml::XmlElement ^ GetXml();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Xml.XmlElement</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the XML representation of the <see cref="T:System.Security.Cryptography.RSA" /> key clause.</summary>
<returns>The XML representation of the <see cref="T:System.Security.Cryptography.RSA" /> key clause.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
Based upon [The RSAKeyValue Element](https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/#sec-RSAKeyValue) in the W3C Recommendation [XML Signature Syntax and Processing Version 1.0](https://www.w3.org/TR/2002/REC-xmldsig-core-20020212).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Key">
<MemberSignature Language="C#" Value="public System.Security.Cryptography.RSA Key { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Security.Cryptography.RSA Key" />
<MemberSignature Language="DocId" Value="P:System.Security.Cryptography.Xml.RSAKeyValue.Key" />
<MemberSignature Language="VB.NET" Value="Public Property Key As RSA" />
<MemberSignature Language="F#" Value="member this.Key : System.Security.Cryptography.RSA with get, set" Usage="System.Security.Cryptography.Xml.RSAKeyValue.Key" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Security::Cryptography::RSA ^ Key { System::Security::Cryptography::RSA ^ get(); void set(System::Security::Cryptography::RSA ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.Cryptography.RSA</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the instance of <see cref="T:System.Security.Cryptography.RSA" /> that holds the public key.</summary>
<value>The instance of <see cref="T:System.Security.Cryptography.RSA" /> that holds the public key.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Security.Cryptography.Xml.RSAKeyValue.Key%2A> property represents the public key to add to an XML digital signature using the `<Modulus>` subelement and the `<Exponent>` subelement of the `<RSAKeyValue>` element.
For more information about XML digital signatures, see the [W3C specification](https://www.w3.org/TR/xmldsig-core/).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="LoadXml">
<MemberSignature Language="C#" Value="public override void LoadXml (System.Xml.XmlElement value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void LoadXml(class System.Xml.XmlElement value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Cryptography.Xml.RSAKeyValue.LoadXml(System.Xml.XmlElement)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub LoadXml (value As XmlElement)" />
<MemberSignature Language="F#" Value="override this.LoadXml : System.Xml.XmlElement -> unit" Usage="rSAKeyValue.LoadXml value" />
<MemberSignature Language="C++ CLI" Value="public:
 override void LoadXml(System::Xml::XmlElement ^ value);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Security</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Cryptography.Xml</AssemblyName>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.Xml.XmlElement" />
</Parameters>
<Docs>
<param name="value">The XML element from which to load the <see cref="T:System.Security.Cryptography.RSA" /> key clause.</param>
<summary>Loads an <see cref="T:System.Security.Cryptography.RSA" /> key clause from an XML element.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
Based upon [The RSAKeyValue Element](https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/#sec-RSAKeyValue) in the W3C Recommendation [XML Signature Syntax and Processing Version 1.0](https://www.w3.org/TR/2002/REC-xmldsig-core-20020212).
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="value" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.Security.Cryptography.CryptographicException">The <paramref name="value" /> parameter is not a valid <see cref="T:System.Security.Cryptography.RSA" /> key clause XML element.</exception>
</Docs>
</Member>
</Members>
</Type>