auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdSecp256k1Error                  protocol.Command = "secp256k1-error"
	CmdSecp256k1Hello                                   = "secp256k1-hello"
	CmdSecp256k1HelloChallenge                          = "secp256k1-hello-challenge"
	CmdSecp256k1HelloChallengeAccepted                  = "secp256k1-hello-challenge-accepted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateMessage

type AuthenticateMessage struct {
	Nonce   [nonceLength]byte // random nonce
	Message string            // human readable message
}

AuthenticateMessage

func MustNewAuthenticateMessage

func MustNewAuthenticateMessage(message string) *AuthenticateMessage

func NewAuthenticateFromBytes

func NewAuthenticateFromBytes(b []byte) (*AuthenticateMessage, error)

func NewAuthenticateMessage

func NewAuthenticateMessage(message string) (*AuthenticateMessage, error)

func (*AuthenticateMessage) Hash

func (am *AuthenticateMessage) Hash() []byte

func (*AuthenticateMessage) Serialize

func (am *AuthenticateMessage) Serialize() []byte

type Secp256k1Auth

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

func NewSecp256k1AuthClient

func NewSecp256k1AuthClient(privKey *dcrsecpk256k1.PrivateKey) (*Secp256k1Auth, error)

func NewSecp256k1AuthServer

func NewSecp256k1AuthServer() (*Secp256k1Auth, error)

func (*Secp256k1Auth) Commands

func (s *Secp256k1Auth) Commands() map[protocol.Command]reflect.Type

Commands returns the protocol commands for this authenticator.

func (*Secp256k1Auth) HandshakeClient

func (s *Secp256k1Auth) HandshakeClient(ctx context.Context, conn protocol.APIConn) error

func (*Secp256k1Auth) HandshakeServer

func (s *Secp256k1Auth) HandshakeServer(ctx context.Context, conn protocol.APIConn) error

func (Secp256k1Auth) RemotePublicKey

func (s Secp256k1Auth) RemotePublicKey() *dcrsecpk256k1.PublicKey

type Secp256k1Hello

type Secp256k1Hello struct {
	PublicKey string `json:"publickey"` // Client compressed public key
}

Hello is a client->server command that sends the client ECDSA public key.

type Secp256k1HelloChallenge

type Secp256k1HelloChallenge struct {
	Message string `json:"message"`
}

HelloChallenge is a server->client command that challenges the the client to sign the hash of the provided message.

type Secp256k1HelloChallengeAccepted

type Secp256k1HelloChallengeAccepted struct {
	Signature string `json:"signature"`
}

Secp256k1HelloChallengeAccepted returns the signature of the HelloChallenge.Message hash.

Jump to

Keyboard shortcuts

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