session

package
v0.6.28-beta.16 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionController

type SessionController struct {
	// contains filtered or unexported fields
}

func NewSessionController

func NewSessionController(accounts ...vault.Account) *SessionController

func (*SessionController) GetAccounts

func (sc *SessionController) GetAccounts() []vault.Account

The `GetAccounts()` function is a method of the `SessionController` struct that returns a slice of `vault.Account` objects. It allows access to the `accounts` field of the `SessionController` struct from outside the struct.

func (*SessionController) SignWithDID

func (sc *SessionController) SignWithDID(did string, data []byte) ([]byte, error)

This function takes in a DID (decentralized identifier) string and a byte slice of data, and returns a byte slice of the signature and an error. It searches through the accounts in the SessionController to find the account with the matching DID, and then calls the Sign method on that account to sign the data. If the account is not found, it returns an error.

func (*SessionController) VerifyWithDID

func (sc *SessionController) VerifyWithDID(did string, data []byte, signature []byte) (bool, error)

The `VerifyWithDID` function is a method of the `SessionController` struct that takes in a DID (decentralized identifier) string, a byte slice of data, and a byte slice of signature. It searches through the accounts in the `SessionController` to find the account with the matching DID, and then calls the `Verify` method on that account to verify the signature against the data. If the account is not found, it returns an error. The function returns a boolean value indicating whether the signature is valid and an error if there is any.

Jump to

Keyboard shortcuts

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