crypto

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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

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
}

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) Sign

func (k *KeyPairs) Sign(relation signer.VerificationRelation, message []byte) ([]byte, 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