Interface ICryptoBackend<T>
Cryptography backend interface.
Namespace: Libplanet.Crypto
Assembly: Libplanet.Crypto.dll
Syntax
public interface ICryptoBackend<T>
where T : HashAlgorithm
Type Parameters
Name | Description |
---|---|
T | A |
Methods
| Improve this Doc View SourceSign(HashDigest<T>, PrivateKey)
Creates a signature from messageHash
with the corresponding
privateKey
.
Declaration
byte[] Sign(HashDigest<T> messageHash, PrivateKey privateKey)
Parameters
Type | Name | Description |
---|---|---|
HashDigest<T> | messageHash | A 32 bytes message hash digest hashed with SHA256 to sign. |
PrivateKey | privateKey | PrivateKey to sign
|
Returns
Type | Description |
---|---|
System.Byte[] | Created a signature from |
Verify(HashDigest<T>, Byte[], PublicKey)
Verifies whether a signature
was created from
a messageHash
with the corresponding PrivateKey.
Declaration
bool Verify(HashDigest<T> messageHash, byte[] signature, PublicKey publicKey)
Parameters
Type | Name | Description |
---|---|---|
HashDigest<T> | messageHash | A 32 bytes message hash digest hashed with SHA256. |
System.Byte[] | signature | A signature that was created from the
|
PublicKey | publicKey | PublicKey used for verification. |
Returns
Type | Description |
---|---|
System.Boolean | true if the |