Skip to content

Commit 29d0f9c

Browse files
pranavkmTratcherJamesNK
authored
Add more doc comments (#28910)
* Add more doc comments * DataProtection * WebUtilities * JSInterop * Apply suggestions from code review Co-authored-by: Chris Ross <[email protected]> Co-authored-by: James Newton-King <[email protected]> Co-authored-by: Chris Ross <[email protected]> Co-authored-by: James Newton-King <[email protected]>
1 parent 674662d commit 29d0f9c

File tree

48 files changed

+458
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+458
-23
lines changed

src/DataProtection/DataProtection/src/AuthenticatedEncryption/AuthenticatedEncryptorFactory.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@ public sealed class AuthenticatedEncryptorFactory : IAuthenticatedEncryptorFacto
2222
{
2323
private readonly ILoggerFactory _loggerFactory;
2424

25+
/// <summary>
26+
/// Initializes a new instance of <see cref="AuthenticatedEncryptorFactory"/>.
27+
/// </summary>
28+
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
2529
public AuthenticatedEncryptorFactory(ILoggerFactory loggerFactory)
2630
{
2731
_loggerFactory = loggerFactory;
2832
}
2933

34+
/// <inheritdoc />
3035
public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
3136
{
32-
var descriptor = key.Descriptor as AuthenticatedEncryptorDescriptor;
33-
if (descriptor == null)
37+
if (key.Descriptor is not AuthenticatedEncryptorDescriptor descriptor)
3438
{
3539
return null;
3640
}

src/DataProtection/DataProtection/src/AuthenticatedEncryption/CngCbcAuthenticatedEncryptorFactory.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ public sealed class CngCbcAuthenticatedEncryptorFactory : IAuthenticatedEncrypto
2323
{
2424
private readonly ILogger _logger;
2525

26+
/// <summary>
27+
/// Initializes a new instance of <see cref="CngCbcAuthenticatedEncryptorFactory"/>.
28+
/// </summary>
29+
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
2630
public CngCbcAuthenticatedEncryptorFactory(ILoggerFactory loggerFactory)
2731
{
2832
_logger = loggerFactory.CreateLogger<CngCbcAuthenticatedEncryptorFactory>();
2933
}
3034

35+
/// <inheritdoc />
3136
public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
3237
{
33-
var descriptor = key.Descriptor as CngCbcAuthenticatedEncryptorDescriptor;
34-
if (descriptor == null)
38+
if (key.Descriptor is not CngCbcAuthenticatedEncryptorDescriptor descriptor)
3539
{
3640
return null;
3741
}

src/DataProtection/DataProtection/src/AuthenticatedEncryption/CngGcmAuthenticatedEncryptorFactory.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ public sealed class CngGcmAuthenticatedEncryptorFactory : IAuthenticatedEncrypto
2323
{
2424
private readonly ILogger _logger;
2525

26+
/// <summary>
27+
/// Initializes a new instance of <see cref="CngCbcAuthenticatedEncryptorFactory"/>.
28+
/// </summary>
29+
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
2630
public CngGcmAuthenticatedEncryptorFactory(ILoggerFactory loggerFactory)
2731
{
2832
_logger = loggerFactory.CreateLogger<CngGcmAuthenticatedEncryptorFactory>();
2933
}
3034

35+
/// <inheritdoc />
3136
public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
3237
{
3338
var descriptor = key.Descriptor as CngGcmAuthenticatedEncryptorDescriptor;

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/AlgorithmConfiguration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
55

66
namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel
77
{
8+
/// <summary>
9+
/// A factory for producing <see cref="IAuthenticatedEncryptorDescriptor"/>.
10+
/// </summary>
811
public abstract class AlgorithmConfiguration
912
{
1013
internal const int KDK_SIZE_IN_BYTES = 512 / 8;

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public sealed class AuthenticatedEncryptorConfiguration : AlgorithmConfiguration
3030
/// </remarks>
3131
public ValidationAlgorithm ValidationAlgorithm { get; set; } = ValidationAlgorithm.HMACSHA256;
3232

33+
/// <inheritdoc />
3334
public override IAuthenticatedEncryptorDescriptor CreateNewDescriptor()
3435
{
3536
var internalConfiguration = (IInternalAlgorithmConfiguration)this;

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/AuthenticatedEncryptorDescriptor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
1212
/// </summary>
1313
public sealed class AuthenticatedEncryptorDescriptor : IAuthenticatedEncryptorDescriptor
1414
{
15+
/// <summary>
16+
/// Initializes a new instance of <see cref="AuthenticatedEncryptorDescriptor"/>.
17+
/// </summary>
18+
/// <param name="configuration">The <see cref="AuthenticatedEncryptorDescriptor"/>.</param>
19+
/// <param name="masterKey">The master key.</param>
1520
public AuthenticatedEncryptorDescriptor(AuthenticatedEncryptorConfiguration configuration, ISecret masterKey)
1621
{
1722
if (configuration == null)
@@ -32,6 +37,7 @@ public AuthenticatedEncryptorDescriptor(AuthenticatedEncryptorConfiguration conf
3237

3338
internal AuthenticatedEncryptorConfiguration Configuration { get; }
3439

40+
/// <inheritdoc/>
3541
public XmlSerializedDescriptorInfo ExportToXml()
3642
{
3743
// <descriptor>

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public sealed class CngCbcAuthenticatedEncryptorConfiguration : AlgorithmConfigu
7373
[ApplyPolicy]
7474
public string? HashAlgorithmProvider { get; set; } = null;
7575

76+
/// <inheritdoc />
7677
public override IAuthenticatedEncryptorDescriptor CreateNewDescriptor()
7778
{
7879
var internalConfiguration = (IInternalAlgorithmConfiguration)this;

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/CngCbcAuthenticatedEncryptorDescriptor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
1414
[SupportedOSPlatform("windows")]
1515
public sealed class CngCbcAuthenticatedEncryptorDescriptor : IAuthenticatedEncryptorDescriptor
1616
{
17+
/// <summary>
18+
/// Initializes a new instance of <see cref="CngCbcAuthenticatedEncryptorDescriptor"/>.
19+
/// </summary>
20+
/// <param name="configuration">The <see cref="CngCbcAuthenticatedEncryptorConfiguration"/>.</param>
21+
/// <param name="masterKey">The master key.</param>
1722
public CngCbcAuthenticatedEncryptorDescriptor(CngCbcAuthenticatedEncryptorConfiguration configuration, ISecret masterKey)
1823
{
1924
if (configuration == null)
@@ -34,6 +39,7 @@ public CngCbcAuthenticatedEncryptorDescriptor(CngCbcAuthenticatedEncryptorConfig
3439

3540
internal CngCbcAuthenticatedEncryptorConfiguration Configuration { get; }
3641

42+
/// <inheritdoc />
3743
public XmlSerializedDescriptorInfo ExportToXml()
3844
{
3945
// <descriptor>

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorConfiguration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public sealed class CngGcmAuthenticatedEncryptorConfiguration : AlgorithmConfigu
4949
[ApplyPolicy]
5050
public int EncryptionAlgorithmKeySize { get; set; } = 256;
5151

52+
/// <inheritdoc />
5253
public override IAuthenticatedEncryptorDescriptor CreateNewDescriptor()
5354
{
5455
var internalConfiguration = (IInternalAlgorithmConfiguration)this;

src/DataProtection/DataProtection/src/AuthenticatedEncryption/ConfigurationModel/CngGcmAuthenticatedEncryptorDescriptor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.Configurat
1414
[SupportedOSPlatform("windows")]
1515
public sealed class CngGcmAuthenticatedEncryptorDescriptor : IAuthenticatedEncryptorDescriptor
1616
{
17+
/// <summary>
18+
/// Initializes a new instance of <see cref="CngGcmAuthenticatedEncryptorDescriptor"/>.
19+
/// </summary>
20+
/// <param name="configuration">The <see cref="CngCbcAuthenticatedEncryptorConfiguration"/>.</param>
21+
/// <param name="masterKey">The master key.</param>
1722
public CngGcmAuthenticatedEncryptorDescriptor(CngGcmAuthenticatedEncryptorConfiguration configuration, ISecret masterKey)
1823
{
1924
if (configuration == null)
@@ -34,6 +39,7 @@ public CngGcmAuthenticatedEncryptorDescriptor(CngGcmAuthenticatedEncryptorConfig
3439

3540
internal CngGcmAuthenticatedEncryptorConfiguration Configuration { get; }
3641

42+
/// <inheritdoc />
3743
public XmlSerializedDescriptorInfo ExportToXml()
3844
{
3945
// <descriptor>

0 commit comments

Comments
 (0)