identity

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Signer principal.Signer
}

Identity holds the service's cryptographic identity.

func New

func New(privateKeyBase64 string) (*Identity, error)

New creates a new identity. If privateKeyBase64 is empty, generates a new key.

func NewFromPEMFile

func NewFromPEMFile(keyFilePath string) (*Identity, error)

NewFromPEMFile creates a new identity from an Ed25519 PEM key file.

func NewFromPEMFileWithDID

func NewFromPEMFileWithDID(keyFilePath string, serviceDID string) (*Identity, error)

NewFromPEMFileWithDID creates a new identity from an Ed25519 PEM key file, optionally wrapping it with a did:web identity. When serviceDID is provided (e.g., "did:web:upload"), the underlying did:key signer is wrapped so the service presents itself as the did:web identity and accepts UCANs addressed to that did:web.

func (*Identity) DID

func (i *Identity) DID() string

DID returns the service's DID.

func (*Identity) DIDDocument

func (i *Identity) DIDDocument() map[string]interface{}

DIDDocument returns a DID document for did:web resolution. This enables other services to verify signatures from this service.

func (*Identity) UnderlyingKeyDID

func (i *Identity) UnderlyingKeyDID() string

UnderlyingKeyDID returns the underlying did:key for wrapped signers. For unwrapped signers, returns the same as DID().

Jump to

Keyboard shortcuts

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