sec

package
v0.25.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

type Pipe struct {
	ssi.In
	ssi.Out
}

Pipe is 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 *ssi.DID, verkey string) *Pipe

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

func (Pipe) Decrypt

func (p Pipe) Decrypt(src []byte) (dst []byte)

Decrypt decrypts the byte slice.

func (Pipe) DecryptGiveKey

func (p Pipe) DecryptGiveKey(src []byte) (dst []byte, vk string)

DecryptGiveKey decrypts scr bytes and returns the verkey as well. Note! It throws an err2 exception. So, there should be at least one error handler in the call stack.

func (Pipe) EA

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

EA returns endpoint of the agent.

func (Pipe) Encrypt

func (p Pipe) Encrypt(src []byte) (dst []byte)

Encrypt encrypts the byte slice. Note! It throws err2 type of an error and needs an error handler in the call stack.

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)

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

func (Pipe) SignAndStamp

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

SignAndStamp sings and stamps a message and returns the verification key. Note! It throws err2 type of an 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)

Verify verifies signature of the message and returns the verification key. Note! It throws err2 type of an 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