Class HotmokaTakamakaChainWalletAdapter<T>
- java.lang.Object
-
- com.h2tcoin.takamakachain.wallet.adapter.impl.HotmokaTakamakaChainWalletAdapter<T>
-
- All Implemented Interfaces:
io.hotmoka.crypto.SignatureAlgorithm<T>
public class HotmokaTakamakaChainWalletAdapter<T> extends Object implements io.hotmoka.crypto.SignatureAlgorithm<T>
- Author:
- giovanni.antino@h2tcoin.com
-
-
Constructor Summary
Constructors Constructor Description HotmokaTakamakaChainWalletAdapter(io.hotmoka.crypto.BytesSupplier<? super T> supplier, InstanceWalletKeystoreInterface iwk, int walletNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyPair
getKeyPair()
PublicKey
publicKeyFromEncoded(byte[] encoded)
byte[]
sign(T what, PrivateKey privateKey)
boolean
verify(T what, PublicKey publicKey, byte[] signature)
-
-
-
Constructor Detail
-
HotmokaTakamakaChainWalletAdapter
public HotmokaTakamakaChainWalletAdapter(io.hotmoka.crypto.BytesSupplier<? super T> supplier, InstanceWalletKeystoreInterface iwk, int walletNumber) throws WalletException, NoSuchAlgorithmException, NoSuchProviderException, IOException
-
-
Method Detail
-
getKeyPair
public KeyPair getKeyPair()
- Specified by:
getKeyPair
in interfaceio.hotmoka.crypto.SignatureAlgorithm<T>
-
sign
public byte[] sign(T what, PrivateKey privateKey) throws InvalidKeyException, SignatureException
- Specified by:
sign
in interfaceio.hotmoka.crypto.SignatureAlgorithm<T>
- Throws:
InvalidKeyException
SignatureException
-
verify
public boolean verify(T what, PublicKey publicKey, byte[] signature) throws InvalidKeyException, SignatureException
- Specified by:
verify
in interfaceio.hotmoka.crypto.SignatureAlgorithm<T>
- Throws:
InvalidKeyException
SignatureException
-
publicKeyFromEncoded
public PublicKey publicKeyFromEncoded(byte[] encoded) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
- Specified by:
publicKeyFromEncoded
in interfaceio.hotmoka.crypto.SignatureAlgorithm<T>
- Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeySpecException
-
-