Class Signature
Definition
- Namespace:
- Tizen.Security.SecureRepository.Crypto
- Assembly:
- Tizen.Security.SecureRepository.dll
Provides the methods for creating and verifying a signature.
public class Signature
- Inheritance
-
objectSignature
Constructors
View SourceSignature(SignatureParameters)
Initializes an instance of Signature class with SignatureParameters.
Declaration
public Signature(SignatureParameters parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| SignatureParameters | parameters | The algorithm specific parameters. |
Properties
View SourceParameters
Gets algorithm specific parameters.
Declaration
public SignatureParameters Parameters { get; }
Property Value
| Type | Description |
|---|---|
| SignatureParameters | Algorithm specific parameters. |
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 | Name of a private key. |
| string | password | Password used in decrypting a private key value. |
| byte[] | message | Message signed with a private key. |
Returns
| Type | Description |
|---|---|
| byte[] | Newly created signature. |
Remarks
Key type specified by the privateKeyAlias should be compatible with the algorithm specified in Parameters.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when |
| System.ArgumentException | Thrown when |
| System.InvalidOperationException | Thrown when key-protecting password does not match.
Thrown when key does not exist with given |
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 | Name of a public key. |
| string | password | Password used in decrypting a public key value. |
| byte[] | message | Input message on which the signature is created. |
| byte[] | signature | Signature that is verified with public key. |
Returns
| Type | Description |
|---|---|
| bool | Signature status. True if the signature is valid. |
Remarks
Key type specified by publicKeyAlias should be compatible with the algorithm specified in Parameters.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when |
| System.ArgumentException | Thrown when |
| System.InvalidOperationException | Thrown when key-protecting password does not match.
Thrown when key does not exist with given |