Appearance
Sign Method
Definition
- Namespace:
JASE.Crypto - Assembly:
JASE.Crypto.dll
Overloads
| Name | Description |
|---|---|
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
| Name | Description |
|---|---|
hash | The hash algorithm to use when signing the data. Default is SHA384. |
input | The data to be signed. |
key | The 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
| Name | Description |
|---|---|
certificate | The X509Certificate2 containing the private key for signing |
hash | The HashProvider to use for hashing the input data (default: HashProvider.SHA256) |
input | The byte array to sign |
padding | The RSA padding scheme to use. Default is DefaultRsaSignaturePadding. |
Returns
The byte array containing the digital signature of the input data