Documentation ¶
Index ¶
- Constants
- func BytesToPrivateKey(keyBytes []byte) (*ecies.PrivateKey, error)
- func CreateEncClient(conn *gethrpc.Client, encKey []byte, addressBytes []byte, ...) (*rpc.EncRPCClient, error)
- func GenerateRandomKey() ([]byte, error)
- func HashForLogging(input []byte) string
- func PrivateKeyToCompressedPubKey(prvKey *ecies.PrivateKey) []byte
- type Config
- type GWAccount
- type GWSessionKey
- type GWUser
- type RPCRequest
Constants ¶
View Source
const ( Localhost = "127.0.0.1" JSONKeyAddress = "address" JSONKeyID = "id" JSONKeyMethod = "method" JSONKeyParams = "params" JSONKeyRPCVersion = "jsonrpc" JSONKeySignature = "signature" JSONKeyType = "type" JSONKeyEncryptionToken = "encryptionToken" JSONKeyFormats = "formats" )
View Source
const ( PathReady = "/ready/" PathJoin = "/join/" PathGetMessage = "/getmessage/" PathAuthenticate = "/authenticate/" PathQuery = "/query/" PathRevoke = "/revoke/" PathHealth = "/health/" PathSessionKeys = "/session-key/" PathNetworkHealth = "/network-health/" PathNetworkConfig = "/network-config/" PathKeyExchange = "/key-exchange/" WSProtocol = "ws://" HTTPProtocol = "http://" EncryptedTokenQueryParameter = "token" AddressQueryParameter = "a" MessageUserIDLen = 40 MessageUserIDLenWithPrefix = 42 EthereumAddressLen = 42 SuccessMsg = "success" APIVersion1 = "/v1" PathVersion = "/version/" DeduplicationBufferSize = 20 DefaultGatewayAuthMessageType = "EIP712" )
View Source
const EncryptionKeySize = 32
Variables ¶
This section is empty.
Functions ¶
func BytesToPrivateKey ¶
func BytesToPrivateKey(keyBytes []byte) (*ecies.PrivateKey, error)
BytesToPrivateKey converts []bytes to *ecies.PrivateKey
func CreateEncClient ¶
func CreateEncClient(conn *gethrpc.Client, encKey []byte, addressBytes []byte, privateKeyBytes []byte, signature []byte, signatureType viewingkey.SignatureType, logger gethlog.Logger) (*rpc.EncRPCClient, error)
func GenerateRandomKey ¶ added in v0.28.0
func HashForLogging ¶ added in v1.0.0
HashForLogging creates a double-hashed hex string of the input bytes for secure logging
func PrivateKeyToCompressedPubKey ¶
func PrivateKeyToCompressedPubKey(prvKey *ecies.PrivateKey) []byte
PrivateKeyToCompressedPubKey converts *ecies.PrivateKey to compressed PubKey ([]byte with length 33)
Types ¶
type Config ¶ added in v0.24.0
type Config struct { WalletExtensionHost string WalletExtensionPortHTTP int WalletExtensionPortWS int NodeRPCHTTPAddress string NodeRPCWebsocketAddress string LogPath string DBPathOverride string // Overrides the database file location. Used in tests. VerboseFlag bool DBType string DBConnectionURL string TenChainID int StoreIncomingTxs bool RateLimitUserComputeTime time.Duration RateLimitWindow time.Duration RateLimitMaxConcurrentRequests int InsideEnclave bool // Indicates if the program is running inside an enclave KeyExchangeURL string EnableTLS bool TLSDomain string EncryptingCertificateEnabled bool DisableCaching bool }
Config contains the configuration required by the WalletExtension.
type GWAccount ¶ added in v0.28.0
type GWAccount struct { User *GWUser Address *common.Address Signature []byte // the signature by the account over the userId - which is derived from the VK SignatureType viewingkey.SignatureType }
type GWSessionKey ¶ added in v1.0.0
type GWSessionKey struct { Account *GWAccount PrivateKey *ecies.PrivateKey // the private key corresponding to the account }
GWSessionKey - an account key-pair registered for a user
type GWUser ¶ added in v0.28.0
type GWUser struct { ID []byte Accounts map[common.Address]*GWAccount UserKey []byte SessionKey *GWSessionKey ActiveSK bool // the session key is active, and it must be used to sign all incoming transactions, and used as the preferred account }
func (GWUser) AllAccounts ¶ added in v1.0.0
func (GWUser) GetAllAddresses ¶ added in v0.28.0
type RPCRequest ¶
type RPCRequest struct { ID json.RawMessage Method string Params []interface{} }
func (*RPCRequest) Clone ¶
func (r *RPCRequest) Clone() *RPCRequest
Clone returns a new instance of the *RPCRequest
Click to show internal directories.
Click to hide internal directories.