crypto_client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LOGGER = logging.MustGetLogger("crypto-client")

Functions

This section is empty.

Types

type CryptoServiceClient

type CryptoServiceClient interface {
	CreateAccount(accountName string) (account nodeconfig.Account, err error, statusCode int, errorCode string)
	SignPayload(accountName string, payload []byte) (signedPayload []byte, err error, statusCode int, errorCode string)
	SignXdr(accountName string, idUnsigned []byte, idSigned []byte, transactionUnsigned []byte) (transactionSigned []byte,
		err error, statusCode int, errorCode string)
	ParticipantSignXdr(accountName string, transactionUnsigned []byte) (transactionSigned []byte,
		err error, statusCode int, errorCode string)
	AddIBMSign(transactionUnsigned []byte) (transactionSigned []byte,
		err error, statusCode int, errorCode string)
	GetIBMAccount() (account model.Account, err error, statusCode int, errorCode string)
}

type MockCryptoServiceClient

type MockCryptoServiceClient struct {
	URL              string
	CreateAccountURL string
}

func CreateMockCryptoServiceClient

func CreateMockCryptoServiceClient() (MockCryptoServiceClient, error)

func (MockCryptoServiceClient) AddIBMSign

func (client MockCryptoServiceClient) AddIBMSign(transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

func (MockCryptoServiceClient) CreateAccount

func (client MockCryptoServiceClient) CreateAccount(accountName string) (nodeconfig.Account, error, int, string)

func (MockCryptoServiceClient) GetIBMAccount

func (client MockCryptoServiceClient) GetIBMAccount() (account model.Account, err error, statusCode int, errorCode string)

func (MockCryptoServiceClient) ParticipantSignXdr

func (client MockCryptoServiceClient) ParticipantSignXdr(accountName string, transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

func (MockCryptoServiceClient) SignPayload

func (client MockCryptoServiceClient) SignPayload(accountName string, payload []byte) (signedPayload []byte, err error, statusCode int, errorCode string)

func (MockCryptoServiceClient) SignXdr

func (client MockCryptoServiceClient) SignXdr(accountName string, idUnsigned []byte, idSigned []byte, transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

type RestCryptoServiceClient

type RestCryptoServiceClient struct {
	Internal_URL                  string
	CreateAccountURL              string
	SignPayloadURL                string
	SignXdrURL                    string
	GetIBMAccountURL              string
	GetIBMSigURL                  string
	ParticipantSignXdrURL         string
	SignPayloadByMasterAccountURL string
}

func CreateRestCryptoServiceClient

func CreateRestCryptoServiceClient(internalUrl string) (RestCryptoServiceClient, error)

func (RestCryptoServiceClient) AddIBMSign

func (client RestCryptoServiceClient) AddIBMSign(transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

func (RestCryptoServiceClient) CreateAccount

func (client RestCryptoServiceClient) CreateAccount(accountName string) (nodeconfig.Account, error, int, string)

func (RestCryptoServiceClient) GetIBMAccount

func (client RestCryptoServiceClient) GetIBMAccount() (account model.Account, err error, statusCode int, errorCode string)

func (RestCryptoServiceClient) ParticipantSignXdr

func (client RestCryptoServiceClient) ParticipantSignXdr(accountName string, transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

func (RestCryptoServiceClient) SignPayload

func (client RestCryptoServiceClient) SignPayload(accountName string, payload []byte) (signedPayload []byte, err error, statusCode int, errorCode string)

func (RestCryptoServiceClient) SignPayloadByMasterAccount

func (client RestCryptoServiceClient) SignPayloadByMasterAccount(payload []byte) (signedPayload []byte, err error)

func (RestCryptoServiceClient) SignXdr

func (client RestCryptoServiceClient) SignXdr(accountName string, idUnsigned []byte, idSigned []byte, transactionUnsigned []byte) (transactionSigned []byte,
	err error, statusCode int, errorCode string)

Jump to

Keyboard shortcuts

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