ecdsa

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys() (privKey []byte, pubKey []byte, err error)

GenerateKeys returns a new key pair, with the private and public key encoded in PEM format.

Types

type ECDSA521

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

func ECDSA521Provider

func ECDSA521Provider(ll log.StandardLogger, privkey string) (*ECDSA521, error)

ECDSA521Provider returns an ECDSA521 auth provider. To use it, use the following configuration to provide a private key: AuthProviders: map[string]map[string]interface{}{"ecdsa": {"private_key": "<key>"}}, While running, keys can be added from a TZ node also from the api, for example: curl -X PUT 'http://localhost:8081/api/ledger/trustzoneAuth/ecdsa_1/<key>' Note: privkey and pubkeys are in the format generated by GenerateKeys() down below The provider resolves "ecdsa" keys in the trustzone auth area, and uses each one as pubkey to try to auth against

func (*ECDSA521) Authenticate

func (e *ECDSA521) Authenticate(m *hub.Message, c chan *hub.Message, tzdata map[string]blockchain.Data) bool

Authenticate a message against a set of pubkeys. It cycles over all the Trusted zone Auth data ( providers options, not where senders ID are stored) and detects any key with ecdsa prefix. Values are assumed to be string and parsed as pubkeys. The pubkeys are then used to authenticate nodes and verify if any of the pubkeys validates the challenge.

func (*ECDSA521) Challenger

func (e *ECDSA521) Challenger(inTrustZone bool, c node.Config, n *node.Node, b *blockchain.Ledger, trustData map[string]blockchain.Data)

Challenger sends ECDSA521 challenges over the public channel if the current node is not in the trusted zone. This start a challenge which eventually should get the node into the TZ

Jump to

Keyboard shortcuts

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