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 HashAlgorithm which corresponds to a digest. |
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 |
See Also
| Improve this Doc View SourceVerify(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 |
Exceptions
Type | Condition |
---|---|
Exception | If any exception is thrown, the given
|