guardian

package
v0.0.0-...-7ece3d8 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFromHexKey

func AddressFromHexKey(privKeyHex string) (pubAddressHex string, err error)

AddressFromHexKey : Given a private key as a hex string, return its corresponding hex address

func Backend

func Backend(c *logical.BackendConfig) *backend

func CreateKey

func CreateKey() (privKeyHex, pubAddress string, err error)

CreateKey : Generates a secp256k1 key, returns its hex representation & corresponding address

func Factory

func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

Factory returns a new backend as logical.Backend.

func SignTxWithHexKey

func SignTxWithHexKey(chainID int, privKeyHex, data string, to common.Address, nonce, gasLimit uint64, amount, gasPrice *big.Int) (jsonTx, rlpTx string, err error)

SignTxWithHexKey : Accepts arguments to NewTransaction (albeit in a different order), returns a signed RLP-encoded transaction string

func SignWithHexKey

func SignWithHexKey(hash []byte, privKeyHex string) (sig []byte, err error)

SignWithHexKey : Given bytes to sign and the hex representation of a private key, loads the key and returns the signature

Types

type Client

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

func ClientFromConfig

func ClientFromConfig(cfg *Config) (*Client, error)

ClientFromConfig : Constructor which takes a Config to produce a Client.

func ClientFromContext

func ClientFromContext(b *backend, ctx context.Context, req *logical.Request) (*Client, error)

ClientFromContext : Uses the Vault backend, context, and request to build a Client.

type Config

type Config struct {
	GuardianToken string `json:"guardian_token"`
	OktaURL       string `json:"okta_url"`
	OktaToken     string `json:"okta_token"`
}

Config : Required constants for running Guardian. guardianToken must hold guardian policy.

func (*Config) Client

func (cfg *Config) Client() (*Client, error)

Client : Call on a Config to get a configured Client.

Jump to

Keyboard shortcuts

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