Skip to content

Sign Method ​

Definition ​

  • Namespace: JASE.Crypto
  • Assembly: JASE.Crypto.dll

Overloads ​

NameDescription
byte[] Sign(byte[] input, byte[] key, HashProvider hash = null)Signs the input data using the provided RSA private key, hash algorithm, and signature padding.
byte[] Sign(byte[] input, X509Certificate2 certificate, HashProvider hash = null, RsaSignaturePadding? padding = null)Sign the input byte array using the private key from the provided X509Certificate2

byte[] Sign(byte[] input, byte[] key, HashProvider hash = null) ​

csharp
byte[] Sign(byte[] input, byte[] key, HashProvider hash = null)

Signs the input data using the provided RSA private key, hash algorithm, and signature padding.

Parameters ​

NameDescription
hashThe hash algorithm to use when signing the data. Default is SHA384.
inputThe data to be signed.
keyThe RSA private key as a byte array.

Returns ​

A byte array containing the digital signature of the input data.

byte[] Sign(byte[] input, X509Certificate2 certificate, HashProvider hash = null, RsaSignaturePadding? padding = null) ​

csharp
byte[] Sign(byte[] input, X509Certificate2 certificate, HashProvider hash = null, RsaSignaturePadding? padding = null)

Sign the input byte array using the private key from the provided X509Certificate2

Parameters ​

NameDescription
certificateThe X509Certificate2 containing the private key for signing
hashThe HashProvider to use for hashing the input data (default: HashProvider.SHA256)
inputThe byte array to sign
paddingThe RSA padding scheme to use. Default is DefaultRsaSignaturePadding.

Returns ​

The byte array containing the digital signature of the input data