|
108 | 108 | <param name="keyName">The name of the key.</param>
|
109 | 109 | <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.AesCng" /> class with the specified key name, which represents an existing persisted AES key.</summary>
|
110 | 110 | <remarks>
|
111 |
| - <format type="text/markdown"><![CDATA[ |
112 |
| - |
113 |
| -## Remarks |
114 |
| - This constructor uses a default <xref:System.Security.Cryptography.CngKeyOpenOptions> value of <xref:System.Security.Cryptography.CngKeyOpenOptions.None> and <xref:System.Security.Cryptography.CngProvider.MicrosoftSoftwareKeyStorageProvider%2A> as the default key storage provider (KSP) to open the key. |
115 |
| - |
| 111 | + <format type="text/markdown"><![CDATA[ |
| 112 | +
|
| 113 | +## Remarks |
| 114 | + This constructor uses a default <xref:System.Security.Cryptography.CngKeyOpenOptions> value of <xref:System.Security.Cryptography.CngKeyOpenOptions.None> and <xref:System.Security.Cryptography.CngProvider.MicrosoftSoftwareKeyStorageProvider%2A> as the default key storage provider (KSP) to open the key. |
| 115 | +
|
116 | 116 | ]]></format>
|
117 | 117 | </remarks>
|
118 | 118 | <exception cref="T:System.ArgumentNullException">
|
|
158 | 158 | <param name="provider">The KSP that contains the key.</param>
|
159 | 159 | <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.AesCng" /> class with the specified key name, which represents an existing persisted AES key, and the specified key storage provider (KSP).</summary>
|
160 | 160 | <remarks>
|
161 |
| - <format type="text/markdown"><![CDATA[ |
162 |
| - |
163 |
| -## Remarks |
164 |
| - A default <xref:System.Security.Cryptography.CngKeyOpenOptions> value of <xref:System.Security.Cryptography.CngKeyOpenOptions.None> is used to open the key. |
165 |
| - |
| 161 | + <format type="text/markdown"><![CDATA[ |
| 162 | +
|
| 163 | +## Remarks |
| 164 | + A default <xref:System.Security.Cryptography.CngKeyOpenOptions> value of <xref:System.Security.Cryptography.CngKeyOpenOptions.None> is used to open the key. |
| 165 | +
|
166 | 166 | ]]></format>
|
167 | 167 | </remarks>
|
168 | 168 | <exception cref="T:System.ArgumentNullException">
|
169 |
| - <paramref name="keyName" /> is <see langword="null" />. |
170 |
| - |
171 |
| - -or- |
172 |
| - |
| 169 | + <paramref name="keyName" /> is <see langword="null" />. |
| 170 | + |
| 171 | + -or- |
| 172 | + |
173 | 173 | <paramref name="provider" /> is <see langword="null" />.</exception>
|
174 | 174 | <exception cref="T:System.PlatformNotSupportedException">Cryptography Next Generation (CNG) is not supported on this system.</exception>
|
175 | 175 | <exception cref="T:System.Security.Cryptography.CryptographicException">All other errors.</exception>
|
|
215 | 215 | <summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.AesCng" /> class with the specified key name, which represents an existing persisted AES key, the specified key storage provider (KSP) and key open options.</summary>
|
216 | 216 | <remarks>To be added.</remarks>
|
217 | 217 | <exception cref="T:System.ArgumentNullException">
|
218 |
| - <paramref name="keyName" /> is <see langword="null" />. |
219 |
| - |
220 |
| - -or- |
221 |
| - |
| 218 | + <paramref name="keyName" /> is <see langword="null" />. |
| 219 | + |
| 220 | + -or- |
| 221 | + |
222 | 222 | <paramref name="provider" /> is <see langword="null" />.</exception>
|
223 | 223 | <exception cref="T:System.PlatformNotSupportedException">Cryptography Next Generation (CNG) is not supported on this system.</exception>
|
224 | 224 | <exception cref="T:System.Security.Cryptography.CryptographicException">All other errors.</exception>
|
|
269 | 269 | <summary>Creates a symmetric AES decryptor object with the current key and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
|
270 | 270 | <returns>A symmetric AES decryptor object.</returns>
|
271 | 271 | <remarks>
|
272 |
| - <format type="text/markdown"><![CDATA[ |
273 |
| - |
274 |
| -## Remarks |
275 |
| - This method decrypts an encrypted message created using the <xref:System.Security.Cryptography.AesCng.CreateEncryptor> overload with the same signature. |
276 |
| - |
| 272 | + <format type="text/markdown"><![CDATA[ |
| 273 | +
|
| 274 | +## Remarks |
| 275 | +
|
| 276 | +This method decrypts an encrypted message created using the <xref:System.Security.Cryptography.AesCng.CreateEncryptor> overload with the same signature. |
| 277 | +
|
277 | 278 | ]]></format>
|
278 | 279 | </remarks>
|
| 280 | + <exception cref="T:System.Security.Cryptography.CryptographicException">.NET 6 and later: CFB128 mode is selected and the key is persisted.</exception> |
279 | 281 | </Docs>
|
280 | 282 | </Member>
|
281 | 283 | <Member MemberName="CreateDecryptor">
|
|
319 | 321 | <summary>Creates a symmetric AES decryptor object with the specified key and initialization vector (IV).</summary>
|
320 | 322 | <returns>A symmetric AES decryptor object.</returns>
|
321 | 323 | <remarks>
|
322 |
| - <format type="text/markdown"><![CDATA[ |
323 |
| - |
324 |
| -## Remarks |
325 |
| - This method decrypts an encrypted message created using the <xref:System.Security.Cryptography.AesCng.CreateEncryptor%28System.Byte%5B%5D%2CSystem.Byte%5B%5D%29> overload with the same signature. |
326 |
| - |
| 324 | + <format type="text/markdown"><![CDATA[ |
| 325 | +
|
| 326 | +## Remarks |
| 327 | + This method decrypts an encrypted message created using the <xref:System.Security.Cryptography.AesCng.CreateEncryptor%28System.Byte%5B%5D%2CSystem.Byte%5B%5D%29> overload with the same signature. |
| 328 | +
|
327 | 329 | > [!NOTE]
|
328 |
| -> If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you want to make use of that key when decrypting the message, you want to set the <xref:System.Security.Cryptography.SymmetricAlgorithm.IV%2A> property and then call the parameterless <xref:System.Security.Cryptography.AesCng.CreateDecryptor> overload instead; otherwise, using this method will create an ephemeral key as specified by the `rgbKey` parameter. |
329 |
| - |
| 330 | +> If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you want to make use of that key when decrypting the message, you want to set the <xref:System.Security.Cryptography.SymmetricAlgorithm.IV%2A> property and then call the parameterless <xref:System.Security.Cryptography.AesCng.CreateDecryptor> overload instead; otherwise, using this method will create an ephemeral key as specified by the `rgbKey` parameter. |
| 331 | +
|
330 | 332 | ]]></format>
|
331 | 333 | </remarks>
|
332 | 334 | <exception cref="T:System.ArgumentNullException">
|
333 | 335 | <paramref name="rgbKey" /> is <see langword="null" />.</exception>
|
334 | 336 | <exception cref="T:System.ArgumentException">
|
335 |
| - <paramref name="rgbKey" /> is not a valid size for this algorithm. |
336 |
| - |
337 |
| - -or- |
338 |
| - |
| 337 | + <paramref name="rgbKey" /> is not a valid size for this algorithm. |
| 338 | + |
| 339 | + -or- |
| 340 | + |
339 | 341 | <paramref name="rgbIV" /> size does not match the block size for this algorithm.</exception>
|
340 | 342 | <exception cref="T:System.Security.Cryptography.CryptographicException">
|
341 |
| - <paramref name="rgbKey" /> is a known weak key for this algorithm and cannot be used. |
342 |
| - |
343 |
| - -or- |
344 |
| - |
| 343 | + <paramref name="rgbKey" /> is a known weak key for this algorithm and cannot be used. |
| 344 | + |
| 345 | + -or- |
| 346 | + |
345 | 347 | <paramref name="rgbIV" /> is <see langword="null" />.</exception>
|
346 | 348 | </Docs>
|
347 | 349 | </Member>
|
|
389 | 391 | <summary>Creates a symmetric AES encryptor object using the current key and initialization vector (<see cref="P:System.Security.Cryptography.SymmetricAlgorithm.IV" />).</summary>
|
390 | 392 | <returns>A symmetric AES encryptor object.</returns>
|
391 | 393 | <remarks>
|
392 |
| - <format type="text/markdown"><![CDATA[ |
393 |
| - |
394 |
| -## Remarks |
395 |
| - Use this method to encrypt a message and then use the <xref:System.Security.Cryptography.AesCng.CreateDecryptor%2A> overload with the same signature to decrypt the result of this method. |
396 |
| - |
| 394 | + <format type="text/markdown"><![CDATA[ |
| 395 | +
|
| 396 | +## Remarks |
| 397 | +
|
| 398 | +Use this method to encrypt a message and then use the <xref:System.Security.Cryptography.AesCng.CreateDecryptor%2A> overload with the same signature to decrypt the result of this method. |
| 399 | +
|
397 | 400 | ]]></format>
|
398 | 401 | </remarks>
|
| 402 | + <exception cref="T:System.Security.Cryptography.CryptographicException">.NET 6 and later: CFB128 mode is selected and the key is persisted.</exception> |
399 | 403 | </Docs>
|
400 | 404 | </Member>
|
401 | 405 | <Member MemberName="CreateEncryptor">
|
|
439 | 443 | <summary>Creates a symmetric AES encryptor object with the specified key and initialization vector (IV).</summary>
|
440 | 444 | <returns>A symmetric AES encryptor object.</returns>
|
441 | 445 | <remarks>
|
442 |
| - <format type="text/markdown"><![CDATA[ |
443 |
| - |
444 |
| -## Remarks |
445 |
| - Use this method to encrypt a message and then use the <xref:System.Security.Cryptography.AesCng.CreateDecryptor%2A> overload with the same signature to decrypt the result of this method. |
446 |
| - |
| 446 | + <format type="text/markdown"><![CDATA[ |
| 447 | +
|
| 448 | +## Remarks |
| 449 | + Use this method to encrypt a message and then use the <xref:System.Security.Cryptography.AesCng.CreateDecryptor%2A> overload with the same signature to decrypt the result of this method. |
| 450 | +
|
447 | 451 | > [!NOTE]
|
448 |
| -> If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you want to make use of that key when encrypting the message, you want to set the <xref:System.Security.Cryptography.SymmetricAlgorithm.IV%2A> property and then call the parameterless <xref:System.Security.Cryptography.AesCng.CreateEncryptor> overload instead; otherwise, using this method will create an ephemeral key as specified by the `rgbKey` parameter. |
449 |
| - |
| 452 | +> If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you want to make use of that key when encrypting the message, you want to set the <xref:System.Security.Cryptography.SymmetricAlgorithm.IV%2A> property and then call the parameterless <xref:System.Security.Cryptography.AesCng.CreateEncryptor> overload instead; otherwise, using this method will create an ephemeral key as specified by the `rgbKey` parameter. |
| 453 | +
|
450 | 454 | ]]></format>
|
451 | 455 | </remarks>
|
452 | 456 | <exception cref="T:System.ArgumentNullException">
|
453 | 457 | <paramref name="rgbKey" /> is <see langword="null" />.</exception>
|
454 | 458 | <exception cref="T:System.ArgumentException">
|
455 |
| - <paramref name="rgbKey" /> is not a valid size for this algorithm. |
456 |
| - |
457 |
| - -or- |
458 |
| - |
| 459 | + <paramref name="rgbKey" /> is not a valid size for this algorithm. |
| 460 | + |
| 461 | + -or- |
| 462 | + |
459 | 463 | <paramref name="rgbIV" /> size does not match the block size for this algorithm.</exception>
|
460 | 464 | <exception cref="T:System.Security.Cryptography.CryptographicException">
|
461 |
| - <paramref name="rgbKey" /> is a known weak key for this algorithm and cannot be used. |
462 |
| - |
463 |
| - -or- |
464 |
| - |
| 465 | + <paramref name="rgbKey" /> is a known weak key for this algorithm and cannot be used. |
| 466 | + |
| 467 | + -or- |
| 468 | + |
465 | 469 | <paramref name="rgbIV" /> is <see langword="null" />.</exception>
|
466 | 470 | </Docs>
|
467 | 471 | </Member>
|
|
611 | 615 | <summary>Gets or sets the key for the <see cref="T:System.Security.Cryptography.AesCng" /> algorithm.</summary>
|
612 | 616 | <value>The key for the <see cref="T:System.Security.Cryptography.AesCng" /> algorithm.</value>
|
613 | 617 | <remarks>
|
614 |
| - <format type="text/markdown"><![CDATA[ |
615 |
| - |
616 |
| -## Remarks |
617 |
| - If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key, when you read the value of the <xref:System.Security.Cryptography.AesCng.Key%2A> property, an attempt to export the key will be made. In this case, if the key is not exportable, a <xref:System.Security.Cryptography.CryptographicException> will be thrown. |
618 |
| - |
619 |
| - In addition to that, if you set the value of the <xref:System.Security.Cryptography.AesCng.Key%2A> property, the persisted key will no longer be used and a temporary key will be used instead. If you need to use the persisted key again, a new instance of <xref:System.Security.Cryptography.AesCng> class needs to be created. |
620 |
| - |
| 618 | + <format type="text/markdown"><![CDATA[ |
| 619 | +
|
| 620 | +## Remarks |
| 621 | + If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key, when you read the value of the <xref:System.Security.Cryptography.AesCng.Key%2A> property, an attempt to export the key will be made. In this case, if the key is not exportable, a <xref:System.Security.Cryptography.CryptographicException> will be thrown. |
| 622 | +
|
| 623 | + In addition to that, if you set the value of the <xref:System.Security.Cryptography.AesCng.Key%2A> property, the persisted key will no longer be used and a temporary key will be used instead. If you need to use the persisted key again, a new instance of <xref:System.Security.Cryptography.AesCng> class needs to be created. |
| 624 | +
|
621 | 625 | ]]></format>
|
622 | 626 | </remarks>
|
623 | 627 | </Docs>
|
|
656 | 660 | <summary>Gets or sets the size, in bits, of the secret key used by the <see cref="T:System.Security.Cryptography.AesCng" /> algorithm.</summary>
|
657 | 661 | <value>The size, in bits, of the secret key used by the <see cref="T:System.Security.Cryptography.AesCng" /> algorithm.</value>
|
658 | 662 | <remarks>
|
659 |
| - <format type="text/markdown"><![CDATA[ |
660 |
| - |
661 |
| -## Remarks |
| 663 | + <format type="text/markdown"><![CDATA[ |
| 664 | +
|
| 665 | +## Remarks |
662 | 666 | For AES, the legal key sizes are 128, 192, and 256 bits.
|
663 | 667 |
|
664 |
| - If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you set the value of the <xref:System.Security.Cryptography.AesCng.KeySize%2A> property, the persisted key will no longer be used and an ephemeral key will be used instead. If you need to use the persisted key again, a new instance of <xref:System.Security.Cryptography.AesCng> class needs to be created. |
665 |
| - |
| 668 | + If you've created the <xref:System.Security.Cryptography.AesCng> object using an existing persisted key and you set the value of the <xref:System.Security.Cryptography.AesCng.KeySize%2A> property, the persisted key will no longer be used and an ephemeral key will be used instead. If you need to use the persisted key again, a new instance of <xref:System.Security.Cryptography.AesCng> class needs to be created. |
| 669 | +
|
666 | 670 | ]]></format>
|
667 | 671 | </remarks>
|
668 | 672 | </Docs>
|
|
0 commit comments