Skip to content

Commit 87a92e5

Browse files
authored
Make some pubternal types in data protection (#12121)
- Make CngAuthenticatedEncryptorBase internal - Left IActivator public because they are used in constructors the XmlKeyManager ctor
1 parent 32782cb commit 87a92e5

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

src/DataProtection/DataProtection/ref/Microsoft.AspNetCore.DataProtection.netstandard2.0.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -217,26 +217,8 @@ public XmlSerializedDescriptorInfo(System.Xml.Linq.XElement serializedDescriptor
217217
public System.Xml.Linq.XElement SerializedDescriptorElement { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
218218
}
219219
}
220-
namespace Microsoft.AspNetCore.DataProtection.Cng.Internal
221-
{
222-
public abstract partial class CngAuthenticatedEncryptorBase : Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor, System.IDisposable
223-
{
224-
protected CngAuthenticatedEncryptorBase() { }
225-
public byte[] Decrypt(System.ArraySegment<byte> ciphertext, System.ArraySegment<byte> additionalAuthenticatedData) { throw null; }
226-
protected unsafe abstract byte[] DecryptImpl(byte* pbCiphertext, uint cbCiphertext, byte* pbAdditionalAuthenticatedData, uint cbAdditionalAuthenticatedData);
227-
public abstract void Dispose();
228-
public byte[] Encrypt(System.ArraySegment<byte> plaintext, System.ArraySegment<byte> additionalAuthenticatedData) { throw null; }
229-
public byte[] Encrypt(System.ArraySegment<byte> plaintext, System.ArraySegment<byte> additionalAuthenticatedData, uint preBufferSize, uint postBufferSize) { throw null; }
230-
protected unsafe abstract byte[] EncryptImpl(byte* pbPlaintext, uint cbPlaintext, byte* pbAdditionalAuthenticatedData, uint cbAdditionalAuthenticatedData, uint cbPreBuffer, uint cbPostBuffer);
231-
}
232-
}
233220
namespace Microsoft.AspNetCore.DataProtection.Internal
234221
{
235-
public partial class DataProtectionBuilder : Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder
236-
{
237-
public DataProtectionBuilder(Microsoft.Extensions.DependencyInjection.IServiceCollection services) { }
238-
public Microsoft.Extensions.DependencyInjection.IServiceCollection Services { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
239-
}
240222
public partial interface IActivator
241223
{
242224
object CreateInstance(System.Type expectedBaseType, string implementationTypeName);

src/DataProtection/DataProtection/src/Cng/Internal/CngAuthenticatedEncryptorBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal
99
/// <summary>
1010
/// Base class used for all CNG-related authentication encryption operations.
1111
/// </summary>
12-
public unsafe abstract class CngAuthenticatedEncryptorBase : IOptimizedAuthenticatedEncryptor, IDisposable
12+
internal unsafe abstract class CngAuthenticatedEncryptorBase : IOptimizedAuthenticatedEncryptor, IDisposable
1313
{
1414
public byte[] Decrypt(ArraySegment<byte> ciphertext, ArraySegment<byte> additionalAuthenticatedData)
1515
{

src/DataProtection/DataProtection/src/Internal/DataProtectionBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.DataProtection.Internal
99
/// <summary>
1010
/// Default implementation of <see cref="IDataProtectionBuilder"/>.
1111
/// </summary>
12-
public class DataProtectionBuilder : IDataProtectionBuilder
12+
internal class DataProtectionBuilder : IDataProtectionBuilder
1313
{
1414
/// <summary>
1515
/// Creates a new configuration object linked to a <see cref="IServiceCollection"/>.

src/DataProtection/DataProtection/test/Cng/CngAuthenticatedEncryptorBaseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void Decrypt_HandlesEmptyCiphertextPointerFixup()
8686
Assert.Equal(new byte[] { 0x20, 0x21, 0x22 }, retVal);
8787
}
8888

89-
public abstract class MockableEncryptor : CngAuthenticatedEncryptorBase
89+
internal abstract class MockableEncryptor : CngAuthenticatedEncryptorBase
9090
{
9191
public override void Dispose()
9292
{

0 commit comments

Comments
 (0)