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.AsymmetricCipherKeyPairgetKeyPairAtIndex(int index)StringgetPublicKeyAtIndex(int keyIndex)returns the public key of the specified indexStringgetSignatureForKeyAtIntex(int i, String message)returns the signature of the message encoded with the key at the specified indexTransactionBeangetTransactionBean(int i, String message)returns the GSON of the transactionbean with the specified index and messageStringgetTransactionBeanJson(int i, String message)aiw.getTransactionBean( keyIndex, TransactionHelper.getInstance().encodeInternalTransactionBeanToGson( InternalTransactionHelper.createStakeTransaction( getPublicKeyAtIndex(keyIndex), to, new Date(), greenValue ) )KeyContexts.WalletCyphergetWalletCypher()returns the wallet cypherStringgetWalletName()Get the value of walletNamestatic voidmain(String[] args)protected voidsetKeyContext(KeyContexts.WalletCypher cypher)do not call this method.booleanverifyTransactionSignature(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:
IOExceptionNoSuchAlgorithmExceptionHashEncodeExceptionInvalidKeySpecExceptionHashAlgorithmNotFoundExceptionHashProviderNotFoundException
-
-
Method Detail
-
getWalletName
public String getWalletName()
Get the value of walletName- Specified by:
getWalletNamein classAbstractCypherProvider- Returns:
- the value of walletName
-
main
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchProviderException, Exception
- Parameters:
args-- Throws:
NoSuchAlgorithmExceptionNoSuchProviderExceptionException
-
getWalletCypher
public KeyContexts.WalletCypher getWalletCypher()
returns the wallet cypher- Specified by:
getWalletCypherin classAbstractCypherProvider- Returns:
-
setKeyContext
protected void setKeyContext(KeyContexts.WalletCypher cypher)
do not call this method. Is not required for the current cypher- Specified by:
setKeyContextin classAbstractCypherProvider- Parameters:
cypher-
-
verifyTransactionSignature
public boolean verifyTransactionSignature(String gsonTransactionBean) throws Exception
returns true if the signature is valid- Specified by:
verifyTransactionSignaturein 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:
getTransactionBeanin 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:
getSignatureForKeyAtIntexin 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:
getPublicKeyAtIndexin classAbstractCypherProvider- Parameters:
keyIndex-- Returns:
- Throws:
Exception
-
getTransactionBeanJson
public String getTransactionBeanJson(int i, String message) throws Exception
Description copied from class:AbstractCypherProvideraiw.getTransactionBean( keyIndex, TransactionHelper.getInstance().encodeInternalTransactionBeanToGson( InternalTransactionHelper.createStakeTransaction( getPublicKeyAtIndex(keyIndex), to, new Date(), greenValue ) )- Specified by:
getTransactionBeanJsonin classAbstractCypherProvider- Returns:
- Throws:
Exception
-
getKeyPairAtIndex
public org.bouncycastle.crypto.AsymmetricCipherKeyPair getKeyPairAtIndex(int index)
-
-