did

package
v0.0.0-...-a5ce5ae Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bls12381G2Identity

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

func (*Bls12381G2Identity) PrivateKey

func (b *Bls12381G2Identity) PrivateKey() crypto.PrivateKey

func (*Bls12381G2Identity) PublicIdentity

func (b *Bls12381G2Identity) PublicIdentity() (*PublicIdentity, error)

type Ed25519Identity

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

func NewEd25519Identity

func NewEd25519Identity(sk []byte) *Ed25519Identity

NewEd25519Identity creates a new Ed25519 type identity

func (*Ed25519Identity) PrivateKey

func (e *Ed25519Identity) PrivateKey() crypto.PrivateKey

func (*Ed25519Identity) PublicIdentity

func (e *Ed25519Identity) PublicIdentity() (*PublicIdentity, error)

PublicIdentity converts public identity of the Ed25519 to be used in chain information

type IdentityStore

type IdentityStore interface {
	Find(id string) (PrivateIdentity, error)
	List() ([]PrivateIdentity, error)
}

IdentityStore to provide a means of looking up private identities and use them in consensus and DID/VC creation

type PrivateIdentity

type PrivateIdentity interface {
	PrivateKey() crypto.PrivateKey
	PublicIdentity() (*PublicIdentity, error)
}

PrivateIdentity contains the secret identity whilst providing a means of producting the public identity of a key

func GenerateBls12381G2Identity

func GenerateBls12381G2Identity() (PrivateIdentity, error)

func GenerateEd25519Identity

func GenerateEd25519Identity(rand io.Reader) (PrivateIdentity, error)

GenerateEd25519Identity generates a new Ed25519 private identity from a given random source

type PublicIdentity

type PublicIdentity struct {
	ID         string      `msgpack:"i" json:"."`
	PublicKeys []PublicKey `msgpack:"p"`
}

PublicIdentity holds the publicly available form of any secret key

func (*PublicIdentity) Matches

func (pi *PublicIdentity) Matches(p *PublicIdentity) bool

Matches checks if a public identity matches another public identity by comparing if any public key is the same

type PublicKey

type PublicKey struct {
	Key crypto.PublicKey `msgpack:"k"`
}

PublicKey a public key identity

func (*PublicKey) AsMultibase

func (pk *PublicKey) AsMultibase() (string, error)

type Resolver

type Resolver interface {
	ResolvePI(did string) (*PublicIdentity, error)
	Resolve(did w3cdid.URL) (*w3cdid.Document, error)
}

Resolver allows for a DID to be resolved agnostically any given source

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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