web5

package module
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

web5-go

Table of Contents

Summary

This repo contains the following packages:

package description
crypto Key Generation, signing, verification, and a Key Manager abstraction
dids DID creation and resolution.
jwk implements a subset of the JSON Web Key spec
jws JWS (JSON Web Signature) signing and verification
jwt JWT (JSON Web Token) parsing, signing, and verification

[!IMPORTANT] Check the README in each directory for more details

crypto

Supported Digital Signature Algorithms:

dids

Supported DID Methods:

jws

JWS signing and verification using DIDs

jwt

JWT signing and verification using DIDs

Development

Prerequisites

We use a submodule for test vectors that make sure we follow the appropriate spec. Running tests will fail without it. To set up the submodule, clone using:

git clone --recurse-submodules git@github.com:TBD54566975/web5-go.git

If you've already cloned, add submodules:

git submodule update --init
hermit

This repo uses hermit to manage all environment dependencies (e.g. just, go).

[!IMPORTANT] run . ./bin/activate-hermit everytime you enter this directory if you don't have hermit shell hooks configured

Git hooks

Before contributing, set up the pre-commit hook by running:

cp .githooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
Helpful Commands

This repo uses just as a command runner. Below is a table of helpful just commands:

command description
just test runs all tests
just lint runs linter
web5 CLI
web5 -h

See cmd/web5/README.md for more information.

Contributing

Each package's README contains in-depth information about the package's structure and suggestions on how add features specific to that package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestVector

type TestVector[I, O any] struct {
	Description string `json:"description"`
	Input       I      `json:"input"`
	Output      O      `json:"output"`
	Errors      bool   `json:"errors"`
}

TestVector is an individual test vector case

type TestVectors

type TestVectors[T, U any] struct {
	Description string             `json:"description"`
	Vectors     []TestVector[T, U] `json:"vectors"`
}

TestVectors are JSON files which are tested against to ensure interop with the specification

func LoadTestVectors

func LoadTestVectors[I, O any](path string) (TestVectors[I, O], error)

LoadTestVectors is for reading the vector at the given path

Directories

Path Synopsis
cmd
Package crypto provides the following functionality: * Key Generation: secp256k1, ed25519 * Signing: secp256k1, ed25519 * Verification: secp256k1, ed25519 * A KeyManager abstraction that can be leveraged to manage/use keys (create, sign etc) as desired per the given use case
Package crypto provides the following functionality: * Key Generation: secp256k1, ed25519 * Signing: secp256k1, ed25519 * Verification: secp256k1, ed25519 * A KeyManager abstraction that can be leveraged to manage/use keys (create, sign etc) as desired per the given use case
dsa
dsa/eddsa
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.
Package eddsa implements the EdDSA signature schemes as per RFC 8032 https://tools.ietf.org/html/rfc8032.
did
Package jwk implements a subset of the JSON Web Key spec (https://tools.ietf.org/html/rfc7517)
Package jwk implements a subset of the JSON Web Key spec (https://tools.ietf.org/html/rfc7517)

Jump to

Keyboard shortcuts

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