Documentation
¶
Index ¶
- Variables
- func CheckSubmitTransactionRequest(req *walletpb.SubmitTransactionRequest) commands.Errors
- type Handler
- func (h *Handler) CreateWallet(name, passphrase string) error
- func (h *Handler) GenerateKeyPair(name, passphrase string) (KeyPair, error)
- func (h *Handler) GetPublicKey(name, pubKey string) (*PublicKey, error)
- func (h *Handler) GetWalletPath(name string) (string, error)
- func (h *Handler) ListPublicKeys(name string) ([]PublicKey, error)
- func (h *Handler) LoginWallet(name, passphrase string) error
- func (h *Handler) LogoutWallet(name string)
- func (h *Handler) SecureGenerateKeyPair(name, passphrase string) (string, error)
- func (h *Handler) SignAny(name, inputData, pubKey string) ([]byte, error)
- func (h *Handler) SignTx(name, tx, pubKey string, blockHeight uint64) (SignedBundle, error)
- func (h *Handler) SignTxV2(name string, req *walletpb.SubmitTransactionRequest, height uint64) (*commandspb.Transaction, error)
- func (h *Handler) TaintKey(name, pubKey, passphrase string) error
- func (h *Handler) UpdateMeta(name, pubKey, passphrase string, meta []Meta) error
- func (h *Handler) VerifyAny(name, inputData, sig, pubKey string) (bool, error)
- func (h *Handler) WalletExists(name string) bool
- type KeyPair
- type KeyRing
- type Meta
- type PublicKey
- type RSAKeys
- type Signature
- type SignedBundle
- type Store
- type Wallet
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWalletDoesNotExists = errors.New("wallet does not exist") ErrWalletAlreadyExists = errors.New("a wallet with the same name already exists") )
View Source
var ( ErrPubKeyDoesNotExist = errors.New("public key does not exist") ErrPubKeyAlreadyTainted = errors.New("public key is already tainted") )
View Source
var (
ErrPubKeyIsTainted = errors.New("public key is tainted")
)
Functions ¶
func CheckSubmitTransactionRequest ¶ added in v0.8.0
func CheckSubmitTransactionRequest(req *walletpb.SubmitTransactionRequest) commands.Errors
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CreateWallet ¶
func (*Handler) GenerateKeyPair ¶ added in v0.8.0
func (*Handler) GetPublicKey ¶
func (*Handler) GetWalletPath ¶ added in v0.8.0
func (*Handler) LoginWallet ¶
func (*Handler) LogoutWallet ¶ added in v0.8.0
func (*Handler) SecureGenerateKeyPair ¶ added in v0.8.0
func (*Handler) SignTx ¶
func (h *Handler) SignTx(name, tx, pubKey string, blockHeight uint64) (SignedBundle, error)
func (*Handler) SignTxV2 ¶ added in v0.8.0
func (h *Handler) SignTxV2(name string, req *walletpb.SubmitTransactionRequest, height uint64) (*commandspb.Transaction, error)
func (*Handler) UpdateMeta ¶
func (*Handler) WalletExists ¶ added in v0.8.0
type KeyPair ¶ added in v0.8.0
type KeyPair struct { Pub string `json:"pub"` Priv string `json:"priv,omitempty"` Algorithm crypto.SignatureAlgorithm `json:"algo"` Tainted bool `json:"tainted"` Meta []Meta `json:"meta"` // contains filtered or unexported fields }
func GenKeypair ¶
func (*KeyPair) MarshalJSON ¶ added in v0.8.0
func (*KeyPair) Sign ¶ added in v0.8.0
func (k *KeyPair) Sign(marshalledData []byte) (*commandspb.Signature, error)
func (*KeyPair) ToPublicKey ¶ added in v0.8.0
ToPublicKey ensures the sensitive information doesn't leak outside.
func (*KeyPair) UnmarshalJSON ¶ added in v0.8.0
type KeyRing ¶ added in v0.8.0
type KeyRing []KeyPair
func NewKeyRing ¶ added in v0.8.0
func NewKeyRing() KeyRing
func (KeyRing) GetPublicKeys ¶ added in v0.8.0
type PublicKey ¶ added in v0.8.0
type PublicKey struct { Key string `json:"pub"` Algorithm crypto.SignatureAlgorithm `json:"algo"` Tainted bool `json:"tainted"` Meta []Meta `json:"meta"` }
type RSAKeys ¶ added in v0.8.0
func GenerateRSAKeys ¶ added in v0.8.0
type SignedBundle ¶
func (*SignedBundle) IntoProto ¶
func (s *SignedBundle) IntoProto() *typespb.SignedBundle
func (SignedBundle) MarshalJSON ¶
func (s SignedBundle) MarshalJSON() ([]byte, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.