diff --git a/src/Microsoft.IdentityModel.Tokens/AsymmetricSignatureProvider.cs b/src/Microsoft.IdentityModel.Tokens/AsymmetricSignatureProvider.cs
index 4ad0cf16fb..586465d9c8 100644
--- a/src/Microsoft.IdentityModel.Tokens/AsymmetricSignatureProvider.cs
+++ b/src/Microsoft.IdentityModel.Tokens/AsymmetricSignatureProvider.cs
@@ -195,14 +195,8 @@ internal bool ValidKeySize()
internal override int ObjectPoolSize => _asymmetricAdapterObjectPool.Size;
#if NET6_0_OR_GREATER
- ///
- /// This must be overridden to produce a signature over the 'input'.
- ///
- /// bytes to sign.
- /// pre allocated span where signature bytes will be placed.
- /// number of bytes written into the signature span.
- /// returns true if creation of signature succeeded, false otherwise.
- internal override bool Sign(ReadOnlySpan input, Span signature, out int bytesWritten)
+ ///
+ public override bool Sign(ReadOnlySpan input, Span signature, out int bytesWritten)
{
if (input == null || input.Length == 0)
throw LogHelper.LogArgumentNullException(nameof(input));
@@ -273,7 +267,8 @@ public override byte[] Sign(byte[] input)
}
}
- internal override byte[] Sign(byte[] input, int offset, int count)
+ ///
+ public override byte[] Sign(byte[] input, int offset, int count)
{
if (input == null || input.Length == 0)
throw LogHelper.LogArgumentNullException(nameof(input));
diff --git a/src/Microsoft.IdentityModel.Tokens/SignatureProvider.cs b/src/Microsoft.IdentityModel.Tokens/SignatureProvider.cs
index 8491b3b28d..1e80d5290c 100644
--- a/src/Microsoft.IdentityModel.Tokens/SignatureProvider.cs
+++ b/src/Microsoft.IdentityModel.Tokens/SignatureProvider.cs
@@ -95,20 +95,36 @@ internal int Release()
/// signed bytes
public abstract byte[] Sign(byte[] input);
- internal virtual byte[] Sign(byte[] input, int offset, int count)
+ ///
+ /// Produces a signature over the specified region of the .
+ ///
+ /// The bytes to produce a signature over.
+ /// The offset to specify the beginning of the region.
+ /// The count to specify the end of the region.
+ /// The signature bytes.
+ public virtual byte[] Sign(byte[] input, int offset, int count)
{
throw LogHelper.LogExceptionMessage(new NotImplementedException());
}
#if NET6_0_OR_GREATER
- internal virtual bool Sign(ReadOnlySpan data, Span destination, out int bytesWritten)
+ ///
+ /// Produces a signature over the and writes it to .
+ ///
+ /// The bytes to produce a signature over.
+ /// The pre-allocated span where signature bytes will be placed.
+ /// The number of bytes written into the signature span.
+ /// returns if creation of signature succeeded, otherwise.
+ public virtual bool Sign(ReadOnlySpan data, Span destination, out int bytesWritten)
{
throw LogHelper.LogExceptionMessage(new NotImplementedException());
}
#endif
+ ///
/// Verifies that the over using the
/// and specified by this
/// are consistent.
+ ///
/// the bytes that were signed.
/// signature to compare against.
/// true if the computed signature matches the signature parameter, false otherwise.
diff --git a/src/Microsoft.IdentityModel.Tokens/SymmetricSignatureProvider.cs b/src/Microsoft.IdentityModel.Tokens/SymmetricSignatureProvider.cs
index ac83fee782..6bd809a768 100644
--- a/src/Microsoft.IdentityModel.Tokens/SymmetricSignatureProvider.cs
+++ b/src/Microsoft.IdentityModel.Tokens/SymmetricSignatureProvider.cs
@@ -204,7 +204,8 @@ public override byte[] Sign(byte[] input)
}
#if NET6_0_OR_GREATER
- internal override bool Sign(ReadOnlySpan input, Span signature, out int bytesWritten)
+ ///
+ public override bool Sign(ReadOnlySpan input, Span signature, out int bytesWritten)
{
if (input == null || input.Length == 0)
throw LogHelper.LogArgumentNullException(nameof(input));
@@ -235,7 +236,8 @@ internal override bool Sign(ReadOnlySpan input, Span signature, out
}
#endif
- internal override byte[] Sign(byte[] input, int offset, int count)
+ ///
+ public override byte[] Sign(byte[] input, int offset, int count)
{
if (input == null || input.Length == 0)
throw LogHelper.LogArgumentNullException(nameof(input));