sec

package
v0.30.39 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.30.9

func Init(defMediaType string)

Types

type Pipe

type Pipe struct {
	In  core.DID
	Out core.DID
}

Pipe is a secure way to transport data between DID connection. All agent to agent communication uses it. For its internal structure we must define the direction of the pipe.

func NewPipeByVerkey

func NewPipeByVerkey(did core.DID, verkey string, route []string) *Pipe

NewPipeByVerkey creates a new secure pipe by our DID and other end's public key.

func (Pipe) EA

func (p Pipe) EA() (ae service.Addr, err error)

EA returns endpoint of the agent.

func (Pipe) IsNull

func (p Pipe) IsNull() bool

IsNull returns true if pipe is null.

func (Pipe) Pack

func (p Pipe) Pack(src []byte) (dst []byte, vk string, err error)

Pack packs the byte slice and returns verification key as well.

func (Pipe) Sign

func (p Pipe) Sign(src []byte) (dst []byte, vk string, err error)

Sign sings the message and returns the verification key. Note! It throws err2 type of error and needs an error handler in the call stack.

func (Pipe) SignAndStamp

func (p Pipe) SignAndStamp(src []byte) (data, dst []byte, vk string, err error)

SignAndStamp sings and stamps a message and returns the verification key. Note! It throws err2 type of error and needs an error handler in the call stack.

func (Pipe) Unpack

func (p Pipe) Unpack(src []byte) (dst []byte, vk string, err error)

Unpack unpacks the source bytes and returns our verification key as well.

func (Pipe) Verify

func (p Pipe) Verify(msg, signature []byte) (yes bool, vk string, err error)

Verify verifies signature of the message and returns the verification key. Note! It throws err2 type of error and needs an error handler in the call stack.

Jump to

Keyboard shortcuts

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