didtest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package didtest provides Personas that can be used for testing. Each Persona has a name, crypto.PrivKey and associated crypto.PubKey and did.DID.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DidToName

func DidToName(d did.DID) string

DidToName retrieve the persona's name from its DID.

Types

type Persona

type Persona int

Persona is a generic participant used for cryptographic testing.

const (
	PersonaAlice Persona = iota + 1
	PersonaBob
	PersonaCarol
	PersonaDan
	PersonaErin
	PersonaFrank
)

The provided Personas were selected from the first few generic participants listed in this table.

func Personas

func Personas() []Persona

Personas returns an (alphabetically) ordered list of the defined Persona values.

func (Persona) DID

func (p Persona) DID() did.DID

DID returns a did.DID based on the Persona's Ed25519 public key.

func (Persona) Name

func (p Persona) Name() string

Name returns the username of the Persona.

func (Persona) PrivKey

func (p Persona) PrivKey() crypto.PrivKey

PrivKey returns the Ed25519 private key for the Persona.

func (Persona) PrivKeyConfig

func (p Persona) PrivKeyConfig() string

func (Persona) PubKey

func (p Persona) PubKey() crypto.PubKey

PubKey returns the Ed25519 public key for the Persona.

func (Persona) PubKeyConfig

func (p Persona) PubKeyConfig() string

PubKeyConfig returns the marshaled and encoded Ed25519 public key for the Persona.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳