AsymmetricSignatureProvider.Sign Method

Produces a signature over input using the AsymmetricSecurityKey and an algorithm passed to AsymmetricSignatureProvider.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel.Tokens.Jwt (in System.IdentityModel.Tokens.Jwt.dll)

Syntax

'Declaration
Public Overrides Function Sign ( _
    input As Byte() _
) As Byte()
public override byte[] Sign(
    byte[] input
)
public:
virtual array<unsigned char>^ Sign(
    array<unsigned char>^ input
) override
abstract Sign : 
        input:byte[] -> byte[] 
override Sign : 
        input:byte[] -> byte[] 
public override function Sign(
    input : byte[]
) : byte[]

Parameters

Return Value

Type: System.Byte[]
Returns a signature from input.

Exceptions

Exception Condition
ArgumentNullException

input is null.

ArgumentException

The length of input is zero.

ObjectDisposedException

If Dispose has been called.

InvalidOperationException
  • If the internal AsymmetricSignatureFormatter is null. This can occur if the constructor parameter willBeUsedforSigning was not true.

  • If the internal HashAlgorithm is null. This can occur if a derived type deletes it or does not create it.

.NET Framework Security

See Also

Reference

AsymmetricSignatureProvider Class

System.IdentityModel.Tokens Namespace