package auth

import "github.com/silence-laboratories/wallet-provider-go-sdk/networkclient/auth"

Index

Types

type Challenge

type Challenge [32]byte

type EphClaim

type EphClaim struct {
	EphID   string          `json:"ephId"`
	EphPK   string          `json:"ephPK"`
	SignAlg EphSigAlgorithm `json:"signAlg"`
	Expiry  uint64          `json:"expiry"`
}

EphClaim represents an ephemeral key claim.

func (*EphClaim) UnmarshalJSON
func (ec *EphClaim) UnmarshalJSON(data []byte) error

type EphSigAlgorithm

type EphSigAlgorithm string

EphSigAlgorithm represents ephemeral key signature algorithm options.

const (
	EphSigAlgorithmED25519   EphSigAlgorithm = "ed25519"
	EphSigAlgorithmSECP256k1 EphSigAlgorithm = "secp256k1"
)
func (EphSigAlgorithm) MarshalJSON
func (esa EphSigAlgorithm) MarshalJSON() ([]byte, error)
func (EphSigAlgorithm) String
func (esa EphSigAlgorithm) String() string

String implements the fmt.Stringer interface for EphSigAlgorithm.

func (*EphSigAlgorithm) UnmarshalJSON
func (esa *EphSigAlgorithm) UnmarshalJSON(data []byte) error

type FinalChallengeHex

type FinalChallengeHex string

Represents the final challenge that will be used for challenge response exchange protocol.

func CalculateFinalChallenge
func CalculateFinalChallenge(serialized []byte, chalsOpt []Challenge) FinalChallengeHex

type UserAuthId

type UserAuthId string

UserAuthId is used to identify user authentication in case of multiple authentications in a single request.

type UserAuthMethod

type UserAuthMethod string

Defines the method used for user authentication.

const (
	UserAuthMethodEOA       UserAuthMethod = "eoa"
	UserAuthMethodEphemeral UserAuthMethod = "ephemeral"
)
func (UserAuthMethod) MarshalJSON
func (uam UserAuthMethod) MarshalJSON() ([]byte, error)
func (UserAuthMethod) String
func (uam UserAuthMethod) String() string
func (*UserAuthMethod) UnmarshalJSON
func (uam *UserAuthMethod) UnmarshalJSON(data []byte) error

type UserAuthentication

type UserAuthentication struct {
	// Credentials contains signing information required for verification.
	Credentials UserCredentials `json:"credentials"`

	// Signature is a signature according to credentials.
	Signature string `json:"signature"`
}

Defines the structure for user authentication. It includes the user credentials and the corresponding signature.

type UserCredentials

type UserCredentials struct {
	// ID is an arbitrary ID of the signature among passed from a user to a verifier.
	ID string `json:"id"`

	// Method defines the format of the credentials field.
	Method UserAuthMethod `json:"method"`

	// Credentials contains public key or a more complex structure required to verify a signature.
	Credentials string `json:"credentials"`
}

UserCredentials contains all the information relevant for a particular signing method. JSON serialization of this structure will be associated with the key share lifecycle.

type UserSignatures

type UserSignatures map[UserAuthId]UserAuthentication

UserSignatures is a map containing multiple user authentications. The key is a unique identifier of the user authentication.