accounttype

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountTypes

func GetAccountTypes() map[uint32]AccountTypeInterface

GetAccountTypes returns all AccountTypeInterface (useful for loops)

func ParseEncodedAccountToAccountAddress

func ParseEncodedAccountToAccountAddress(accTypeInt int32, encodedAccountAddress string) ([]byte, error)

ParseEncodedAccountToAccountAddress parse an encoded account type into a full account address ([]byte) Note: we must know the account type first to do it

Types

type AccountTypeInterface

type AccountTypeInterface interface {
	// SetAccountPublicKey set/update account public key
	SetAccountPublicKey(accountPublicKey []byte)
	// GetAccountAddress return the full (raw) account address in bytes
	GetAccountAddress() ([]byte, error)
	// GetTypeInt return the value of the account address type in int
	GetTypeInt() int32
	// GetAccountPublicKey return an account address in bytes
	GetAccountPublicKey() []byte
	// GetAccountPrefix return the value of current account address table prefix in the database
	GetAccountPrefix() string
	// GetName return the name of the account address type
	GetName() string
	// GetAccountPublicKeyLength return the length of this account address type (for parsing tx and message bytes that embed an address)
	GetAccountPublicKeyLength() uint32
	// GetEncodedAddress return a string encoded/formatted account address
	GetEncodedAddress() (string, error)
	// GetAccountPublicKeyString return a string encoded account public key
	GetAccountPublicKeyString() (string, error)
	GetAccountPrivateKey() ([]byte, error)
	// IsEqual checks if two account have same type and pub key
	IsEqual(acc AccountTypeInterface) bool
	// GetSignatureType return the signature type number for this account type
	GetSignatureType() model.SignatureType
	// GetSignatureLength return the signature length for this account type
	GetSignatureLength() uint32

	// Sign accept a payload to be signed with an account seed then return the signature byte based on the
	Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)
	VerifySignature(payload, signature, accountAddress []byte) error
	GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error
}

AccountTypeInterface interface define the different behavior of each address

func NewAccountType

func NewAccountType(accTypeInt int32, accPubKey []byte) (AccountTypeInterface, error)

NewAccountType returns the appropriate AccountTypeInterface object based on the account account type nul and account public key

func NewAccountTypeFromAccount

func NewAccountTypeFromAccount(accountAddress []byte) (AccountTypeInterface, error)

NewAccountTypeFromAccount returns the appropriate AccountTypeInterface object based on the account full address (account type + account public key)

func ParseBytesToAccountType

func ParseBytesToAccountType(buffer *bytes.Buffer) (AccountTypeInterface, error)

ParseBytesToAccountType parse an AccountAddress from a bytes.Buffer and returns the appropriate AccountTypeInterface object

type BTCAccountType

type BTCAccountType struct {
	// contains filtered or unexported fields
}

BTCAccountType a dummy account type

func (*BTCAccountType) GenerateAccountFromSeed

func (acc *BTCAccountType) GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error

func (*BTCAccountType) GetAccountAddress

func (acc *BTCAccountType) GetAccountAddress() ([]byte, error)

func (*BTCAccountType) GetAccountPrefix

func (acc *BTCAccountType) GetAccountPrefix() string

func (*BTCAccountType) GetAccountPrivateKey

func (acc *BTCAccountType) GetAccountPrivateKey() ([]byte, error)

func (*BTCAccountType) GetAccountPublicKey

func (acc *BTCAccountType) GetAccountPublicKey() []byte

func (*BTCAccountType) GetAccountPublicKeyLength

func (acc *BTCAccountType) GetAccountPublicKeyLength() uint32

func (*BTCAccountType) GetAccountPublicKeyString

func (acc *BTCAccountType) GetAccountPublicKeyString() (string, error)

func (*BTCAccountType) GetEncodedAddress

func (acc *BTCAccountType) GetEncodedAddress() (string, error)

func (*BTCAccountType) GetName

func (acc *BTCAccountType) GetName() string

func (*BTCAccountType) GetSignatureLength

func (acc *BTCAccountType) GetSignatureLength() uint32

func (*BTCAccountType) GetSignatureType

func (acc *BTCAccountType) GetSignatureType() model.SignatureType

func (*BTCAccountType) GetTypeInt

func (acc *BTCAccountType) GetTypeInt() int32

func (*BTCAccountType) IsEqual

func (acc *BTCAccountType) IsEqual(acc2 AccountTypeInterface) bool

func (*BTCAccountType) SetAccountPublicKey

func (acc *BTCAccountType) SetAccountPublicKey(accountPublicKey []byte)

func (*BTCAccountType) Sign

func (acc *BTCAccountType) Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)

func (*BTCAccountType) VerifySignature

func (acc *BTCAccountType) VerifySignature(payload, signature, fullAccountAddress []byte) error

type ETHAccountType

type ETHAccountType struct {
	// contains filtered or unexported fields
}

ETHAccountType the default account type

func (*ETHAccountType) DecodePublicKeyFromAddress

func (acc *ETHAccountType) DecodePublicKeyFromAddress(address string) ([]byte, error)

func (*ETHAccountType) GenerateAccountFromSeed

func (acc *ETHAccountType) GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error

func (*ETHAccountType) GetAccountAddress

func (acc *ETHAccountType) GetAccountAddress() ([]byte, error)

func (*ETHAccountType) GetAccountPrefix

func (acc *ETHAccountType) GetAccountPrefix() string

func (*ETHAccountType) GetAccountPrivateKey

func (acc *ETHAccountType) GetAccountPrivateKey() ([]byte, error)

GetAccountPrivateKey: we don't store neither generate private key of this account type as the private key resides in the eID

func (*ETHAccountType) GetAccountPublicKey

func (acc *ETHAccountType) GetAccountPublicKey() []byte

func (*ETHAccountType) GetAccountPublicKeyLength

func (acc *ETHAccountType) GetAccountPublicKeyLength() uint32

func (*ETHAccountType) GetAccountPublicKeyString

func (acc *ETHAccountType) GetAccountPublicKeyString() (string, error)

func (*ETHAccountType) GetEncodedAddress

func (acc *ETHAccountType) GetEncodedAddress() (string, error)

func (*ETHAccountType) GetName

func (acc *ETHAccountType) GetName() string

func (*ETHAccountType) GetSignatureLength

func (acc *ETHAccountType) GetSignatureLength() uint32

func (*ETHAccountType) GetSignatureType

func (acc *ETHAccountType) GetSignatureType() model.SignatureType

func (*ETHAccountType) GetTypeInt

func (acc *ETHAccountType) GetTypeInt() int32

func (*ETHAccountType) IsEqual

func (acc *ETHAccountType) IsEqual(acc2 AccountTypeInterface) bool

func (*ETHAccountType) SetAccountPublicKey

func (acc *ETHAccountType) SetAccountPublicKey(accountPublicKey []byte)

func (*ETHAccountType) Sign

func (acc *ETHAccountType) Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)

Sign: Sign the payload with ethereum private key

func (*ETHAccountType) VerifySignature

func (acc *ETHAccountType) VerifySignature(payload, signature, accountAddress []byte) error

type EmptyAccountType

type EmptyAccountType struct {
	// contains filtered or unexported fields
}

EmptyAccountType the default account type

func (*EmptyAccountType) GenerateAccountFromSeed

func (acc *EmptyAccountType) GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error

func (*EmptyAccountType) GetAccountAddress

func (acc *EmptyAccountType) GetAccountAddress() ([]byte, error)

func (*EmptyAccountType) GetAccountPrefix

func (acc *EmptyAccountType) GetAccountPrefix() string

func (*EmptyAccountType) GetAccountPrivateKey

func (acc *EmptyAccountType) GetAccountPrivateKey() ([]byte, error)

func (*EmptyAccountType) GetAccountPublicKey

func (acc *EmptyAccountType) GetAccountPublicKey() []byte

func (*EmptyAccountType) GetAccountPublicKeyLength

func (acc *EmptyAccountType) GetAccountPublicKeyLength() uint32

func (*EmptyAccountType) GetAccountPublicKeyString

func (acc *EmptyAccountType) GetAccountPublicKeyString() (string, error)

func (*EmptyAccountType) GetEncodedAddress

func (acc *EmptyAccountType) GetEncodedAddress() (string, error)

func (*EmptyAccountType) GetName

func (acc *EmptyAccountType) GetName() string

func (*EmptyAccountType) GetSignatureLength

func (acc *EmptyAccountType) GetSignatureLength() uint32

func (*EmptyAccountType) GetSignatureType

func (acc *EmptyAccountType) GetSignatureType() model.SignatureType

func (*EmptyAccountType) GetTypeInt

func (acc *EmptyAccountType) GetTypeInt() int32

func (*EmptyAccountType) IsEqual

func (acc *EmptyAccountType) IsEqual(acc2 AccountTypeInterface) bool

func (*EmptyAccountType) SetAccountPublicKey

func (acc *EmptyAccountType) SetAccountPublicKey(accountPublicKey []byte)

func (*EmptyAccountType) Sign

func (acc *EmptyAccountType) Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)

func (*EmptyAccountType) VerifySignature

func (acc *EmptyAccountType) VerifySignature(payload, signature, accountAddress []byte) error

type EstoniaEidAccountType

type EstoniaEidAccountType struct {
	// contains filtered or unexported fields
}

EstoniaEidAccountType the default account type

func (*EstoniaEidAccountType) DecodePublicKeyFromAddress

func (acc *EstoniaEidAccountType) DecodePublicKeyFromAddress(address string) ([]byte, error)

func (*EstoniaEidAccountType) GenerateAccountFromSeed

func (acc *EstoniaEidAccountType) GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error

func (*EstoniaEidAccountType) GetAccountAddress

func (acc *EstoniaEidAccountType) GetAccountAddress() ([]byte, error)

func (*EstoniaEidAccountType) GetAccountPrefix

func (acc *EstoniaEidAccountType) GetAccountPrefix() string

func (*EstoniaEidAccountType) GetAccountPrivateKey

func (acc *EstoniaEidAccountType) GetAccountPrivateKey() ([]byte, error)

GetAccountPrivateKey: we don't store neither generate private key of this account type as the private key resides in the eID

func (*EstoniaEidAccountType) GetAccountPublicKey

func (acc *EstoniaEidAccountType) GetAccountPublicKey() []byte

func (*EstoniaEidAccountType) GetAccountPublicKeyLength

func (acc *EstoniaEidAccountType) GetAccountPublicKeyLength() uint32

func (*EstoniaEidAccountType) GetAccountPublicKeyString

func (acc *EstoniaEidAccountType) GetAccountPublicKeyString() (string, error)

func (*EstoniaEidAccountType) GetEncodedAddress

func (acc *EstoniaEidAccountType) GetEncodedAddress() (string, error)

func (*EstoniaEidAccountType) GetName

func (acc *EstoniaEidAccountType) GetName() string

func (*EstoniaEidAccountType) GetSignatureLength

func (acc *EstoniaEidAccountType) GetSignatureLength() uint32

func (*EstoniaEidAccountType) GetSignatureType

func (acc *EstoniaEidAccountType) GetSignatureType() model.SignatureType

func (*EstoniaEidAccountType) GetTypeInt

func (acc *EstoniaEidAccountType) GetTypeInt() int32

func (*EstoniaEidAccountType) IsEqual

func (acc *EstoniaEidAccountType) IsEqual(acc2 AccountTypeInterface) bool

func (*EstoniaEidAccountType) SetAccountPublicKey

func (acc *EstoniaEidAccountType) SetAccountPublicKey(accountPublicKey []byte)

func (*EstoniaEidAccountType) Sign

func (acc *EstoniaEidAccountType) Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)

Sign: this account type and signature comes only from Estonia eID and we don't have private key of the accounts so we don't sign sign for this type of account.

func (*EstoniaEidAccountType) VerifySignature

func (acc *EstoniaEidAccountType) VerifySignature(payload, signature, accountAddress []byte) error

type ZbcAccountType

type ZbcAccountType struct {
	// contains filtered or unexported fields
}

ZbcAccountType the default account type

func (*ZbcAccountType) GenerateAccountFromSeed

func (acc *ZbcAccountType) GenerateAccountFromSeed(seed string, optionalParams ...interface{}) error

func (*ZbcAccountType) GetAccountAddress

func (acc *ZbcAccountType) GetAccountAddress() ([]byte, error)

func (*ZbcAccountType) GetAccountPrefix

func (acc *ZbcAccountType) GetAccountPrefix() string

func (*ZbcAccountType) GetAccountPrivateKey

func (acc *ZbcAccountType) GetAccountPrivateKey() ([]byte, error)

func (*ZbcAccountType) GetAccountPublicKey

func (acc *ZbcAccountType) GetAccountPublicKey() []byte

func (*ZbcAccountType) GetAccountPublicKeyLength

func (acc *ZbcAccountType) GetAccountPublicKeyLength() uint32

func (*ZbcAccountType) GetAccountPublicKeyString

func (acc *ZbcAccountType) GetAccountPublicKeyString() (string, error)

func (*ZbcAccountType) GetEncodedAddress

func (acc *ZbcAccountType) GetEncodedAddress() (string, error)

func (*ZbcAccountType) GetName

func (acc *ZbcAccountType) GetName() string

func (*ZbcAccountType) GetSignatureLength

func (acc *ZbcAccountType) GetSignatureLength() uint32

func (*ZbcAccountType) GetSignatureType

func (acc *ZbcAccountType) GetSignatureType() model.SignatureType

func (*ZbcAccountType) GetTypeInt

func (acc *ZbcAccountType) GetTypeInt() int32

func (*ZbcAccountType) IsEqual

func (acc *ZbcAccountType) IsEqual(acc2 AccountTypeInterface) bool

func (*ZbcAccountType) SetAccountPublicKey

func (acc *ZbcAccountType) SetAccountPublicKey(accountPublicKey []byte)

func (*ZbcAccountType) Sign

func (acc *ZbcAccountType) Sign(payload []byte, seed string, optionalParams ...interface{}) ([]byte, error)

func (*ZbcAccountType) VerifySignature

func (acc *ZbcAccountType) VerifySignature(payload, signature, accountAddress []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL