Package com.h2tcoin.takamakachain.wallet
Class CypherProviderBCED25519
- java.lang.Object
-
- com.h2tcoin.takamakachain.wallet.AbstractCypherProvider
-
- com.h2tcoin.takamakachain.wallet.CypherProviderBCED25519
-
public class CypherProviderBCED25519 extends AbstractCypherProvider
this class is not thread safe, if it is to be used inside a singleton it must be taken into account.- Author:
- giovanni.antino@h2tcoin.com
-
-
Constructor Summary
Constructors Constructor Description CypherProviderBCED25519()
CypherProviderBCED25519(String walletName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.crypto.AsymmetricCipherKeyPair
getKeyPairAtIndex(int index)
String
getPublicKeyAtIndex(int keyIndex)
returns the public key of the specified indexString
getSignatureForKeyAtIntex(int i, String message)
returns the signature of the message encoded with the key at the specified indexTransactionBean
getTransactionBean(int i, String message)
returns the GSON of the transactionbean with the specified index and messageString
getTransactionBeanJson(int i, String message)
aiw.getTransactionBean( keyIndex, TransactionHelper.getInstance().encodeInternalTransactionBeanToGson( InternalTransactionHelper.createStakeTransaction( getPublicKeyAtIndex(keyIndex), to, new Date(), greenValue ) )KeyContexts.WalletCypher
getWalletCypher()
returns the wallet cypherString
getWalletName()
Get the value of walletNamestatic void
main(String[] args)
protected void
setKeyContext(KeyContexts.WalletCypher cypher)
do not call this method.boolean
verifyTransactionSignature(String gsonTransactionBean)
returns true if the signature is valid
-
-
-
Constructor Detail
-
CypherProviderBCED25519
public CypherProviderBCED25519() throws IOException, NoSuchAlgorithmException, HashEncodeException, InvalidKeySpecException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
CypherProviderBCED25519
public CypherProviderBCED25519(String walletName) throws IOException, NoSuchAlgorithmException, HashEncodeException, InvalidKeySpecException, HashAlgorithmNotFoundException, HashProviderNotFoundException, HashEncodeException
- Parameters:
walletName
-- Throws:
IOException
NoSuchAlgorithmException
HashEncodeException
InvalidKeySpecException
HashAlgorithmNotFoundException
HashProviderNotFoundException
-
-
Method Detail
-
getWalletName
public String getWalletName()
Get the value of walletName- Specified by:
getWalletName
in classAbstractCypherProvider
- Returns:
- the value of walletName
-
main
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchProviderException, Exception
- Parameters:
args
-- Throws:
NoSuchAlgorithmException
NoSuchProviderException
Exception
-
getWalletCypher
public KeyContexts.WalletCypher getWalletCypher()
returns the wallet cypher- Specified by:
getWalletCypher
in classAbstractCypherProvider
- Returns:
-
setKeyContext
protected void setKeyContext(KeyContexts.WalletCypher cypher)
do not call this method. Is not required for the current cypher- Specified by:
setKeyContext
in classAbstractCypherProvider
- Parameters:
cypher
-
-
verifyTransactionSignature
public boolean verifyTransactionSignature(String gsonTransactionBean) throws Exception
returns true if the signature is valid- Specified by:
verifyTransactionSignature
in classAbstractCypherProvider
- Parameters:
gsonTransactionBean
-- Returns:
- Throws:
Exception
-
getTransactionBean
public TransactionBean getTransactionBean(int i, String message) throws Exception
returns the GSON of the transactionbean with the specified index and message- Specified by:
getTransactionBean
in classAbstractCypherProvider
- Parameters:
i
-message
-- Returns:
- Throws:
Exception
-
getSignatureForKeyAtIntex
public String getSignatureForKeyAtIntex(int i, String message) throws Exception
returns the signature of the message encoded with the key at the specified index- Specified by:
getSignatureForKeyAtIntex
in classAbstractCypherProvider
- Parameters:
i
-message
-- Returns:
- Throws:
Exception
-
getPublicKeyAtIndex
public String getPublicKeyAtIndex(int keyIndex) throws Exception
returns the public key of the specified index- Specified by:
getPublicKeyAtIndex
in classAbstractCypherProvider
- Parameters:
keyIndex
-- Returns:
- Throws:
Exception
-
getTransactionBeanJson
public String getTransactionBeanJson(int i, String message) throws Exception
Description copied from class:AbstractCypherProvider
aiw.getTransactionBean( keyIndex, TransactionHelper.getInstance().encodeInternalTransactionBeanToGson( InternalTransactionHelper.createStakeTransaction( getPublicKeyAtIndex(keyIndex), to, new Date(), greenValue ) )- Specified by:
getTransactionBeanJson
in classAbstractCypherProvider
- Returns:
- Throws:
Exception
-
getKeyPairAtIndex
public org.bouncycastle.crypto.AsymmetricCipherKeyPair getKeyPairAtIndex(int index)
-
-