crypto

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DidPrefix        = "did:knox:"
	ProofType        = "Ed25519VerificationKey2020"
	KeyAgreementType = "X25519KeyAgreementKey2019"
)

Variables

View Source
var MultiCodecPrefix = []byte{0xed, 0x01}

Functions

func DecodePrefixed

func DecodePrefixed(encoded_key string) (mb.Encoding, []byte, error)

Types

type CryptoManager

type CryptoManager interface {
	GenerateKeyPair(mnemonic string) (*KeyPairs, error)
	GenerateMnemonic() (string, error)
}

func NewCryptoManager

func NewCryptoManager() CryptoManager

type KeyPairs

type KeyPairs struct {
	Mnemonic         string
	MasterPublicKey  string
	MasterPrivateKey []byte

	AuthenticationPublicKey  string
	AuthenticationPrivateKey []byte

	CapabilityInvocationPublicKey  string
	CapabilityInvocationPrivateKey []byte

	CapabilityDelegationPublicKey  string
	CapabilityDelegationPrivateKey []byte

	AssertionMethodPublicKey  string
	AssertionMethodPrivateKey []byte

	KeyAgreementPublicKey  string
	KeyAgreementPrivateKey []byte
}

func (*KeyPairs) GetDid

func (k *KeyPairs) GetDid() string

func (*KeyPairs) GetPrivateKey

func (k *KeyPairs) GetPrivateKey(relation signer.VerificationRelation) []byte

func (*KeyPairs) GetPublicKey

func (k *KeyPairs) GetPublicKey(relation signer.VerificationRelation) ([]byte, error)

func (*KeyPairs) GetVerificationMethod added in v0.1.9

func (k *KeyPairs) GetVerificationMethod(rel signer.VerificationRelation) string

func (*KeyPairs) Sign

func (k *KeyPairs) Sign(relation signer.VerificationRelation, message []byte) (*signer.SigningResponse, error)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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