Class Signature
Definition
- Namespace:
- Tizen.Security.SecureRepository.Crypto
- Assembly:
- Tizen.Security.SecureRepository.dll
This class provides the methods for creating and verifying a signature.
public class Signature
- Inheritance
-
objectSignature
Constructors
View SourceSignature(SignatureParameters)
A constructor of Signature that takes the algorithm specific parameters.
Declaration
public Signature(SignatureParameters parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| SignatureParameters | parameters | The algorithm specific parameters. |
Properties
View SourceParameters
The algorithm specific parameters.
Declaration
public SignatureParameters Parameters { get; }
Property Value
| Type | Description |
|---|---|
| SignatureParameters |
Methods
View SourceSign(string, string, byte[])
Creates a signature on a given message using a private key and returns the signature.
Declaration
public byte[] Sign(string privateKeyAlias, string password, byte[] message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | privateKeyAlias | The name of private key. |
| string | password | The password used in decrypting a private key value. |
| byte[] | message | The message that is signed with a private key. |
Returns
| Type | Description |
|---|---|
| byte[] | A newly created signature. |
Remarks
The key type specified by the privateKeyAlias should be compatible with the algorithm specified in Parameters.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The privateKeyAlias or message is null. |
| System.ArgumentException | The privateKeyAlias is invalid format. |
| System.InvalidOperationException | The key-protecting password isn't matched. The key does not exist with the privateKeyAlias. |
Verify(string, string, byte[], byte[])
Verifies a given signature on a given message using a public key and returns the signature status.
Declaration
public bool Verify(string publicKeyAlias, string password, byte[] message, byte[] signature)
Parameters
| Type | Name | Description |
|---|---|---|
| string | publicKeyAlias | The name of public key. |
| string | password | The password used in decrypting a public key value. |
| byte[] | message | The input on which the signature is created. |
| byte[] | signature | The signature that is verified with public key. |
Returns
| Type | Description |
|---|---|
| bool | The signature status. True is returned when the signature is valid. |
Remarks
The key type specified by publicKeyAlias should be compatible with the algorithm specified in Parameters.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The publicKeyAlias, message or signature is null. |
| System.ArgumentException | The publicKeyAlias is invalid format. |
| System.InvalidOperationException | The key-protecting password isn't matched. The key does not exist with the publicKeyAlias. |