features

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SCOPE_SEPARATOR ...
	SCOPE_SEPARATOR = "§"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination struct {
	Purposes []purpose.Purpose `json:"purposes"`
	Scopes   []string          `json:"scopes"`
}

Destination ...

type Scope

type Scope struct {
	// Type is an available scope type, eg. `ScopeType{Code: "f1", Name: "SIRET"}`
	Type scope.Type

	// Value is the base64-encoded encryption of the actual corresponding value with the stakeholder's private key.
	Value string
}

Scope ...

func ToScope

func ToScope(st scope.Type, rawValue string, beneficiaryPrivateKey string, emitterPrivateKey string) (s Scope, err error)

ToScope returns the Scope to add to the list of scopes written in the scope field using the passed raw value (eg. 522974591) of the corresponding scope type with both signers' private keys. The final format of the field is the following: <scopeType.code><beneficiaryObfuscation>§<emitterObfuscation>, the obfuscation using the Obfuscator cipher from the Crumbl&trade; library, then encoding its result in Base64 (without the trailing equal signs), eg. `0xf00xMQUOAF9cWAUIVg§YFVWVQ0NWllTAg`

func (*Scope) GetRawValue

func (s *Scope) GetRawValue(privateKey string) (raw string, err error)

GetRawValue returns the underlying value in clear.

func (*Scope) ParseValue

func (s *Scope) ParseValue() (string, string, error)

ParseValue ...

func (Scope) String

func (s Scope) String() string

String formats the scope according to the following definition: 0x<type.code>0x<value>, eg. `0xf00xMQUOAF9cWAUIVg§YFVWVQ0NWllTAg`

type Scopes

type Scopes []Scope

Scopes ...

func ParseScope

func ParseScope(fieldValue []string) (list Scopes, err error)

ParseScope build the list of scopes from the passed string

func (Scopes) Has

func (ss Scopes) Has(s Scope) bool

Has checks whether the passed scope is in the list of scopes.

func (Scopes) ToField

func (ss Scopes) ToField() []string

ToField returns the value of the scope field, ie an array of stringified scopes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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