pearl

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseContainer

type CloseContainer struct {
	Checksum   []byte
	PayloadKey *key.RawKey
}

type CloseRequestPearl

type CloseRequestPearl struct {
	Type    string
	Payload []byte
	Owners  PearlOwner
}

type CreatorOwners

type CreatorOwners struct {
	Creator key.PublicKey // public-key
	Tokens  []JWTokenPearlClaim
}

CreatorOwners is the collection with Creators publickey and the JWT-Tokens sign and encrypted

func (*CreatorOwners) AsJSON

func (co *CreatorOwners) AsJSON() *JSONCreatorOwners

AsJSON converts a CreatorOwners into the Json representation

type JSONCreatorOwners

type JSONCreatorOwners struct {
	Creator string
	Tokens  []JWTokenPearlClaim
}

JSONCreatorOwners is the json representation of the CreatorOwners

func (*JSONCreatorOwners) FromJSON

func (jcp *JSONCreatorOwners) FromJSON() (*CreatorOwners, error)

FromJSON converts from Json to CreatorOwners

type JSONPearl

type JSONPearl struct {
	FingerPrint string
	Type        string
	Payload     string // base64
	Owners      JSONCreatorOwners
}

JSONPearl is the Json representation of a Pearl

func (*JSONPearl) FromJSON

func (jp *JSONPearl) FromJSON() (*Pearl, error)

FromJSON converts a json pearl to a Pearl

type JWTokenPearlClaim

type JWTokenPearlClaim string

JWTokenPearlClaim the Claim encoded as a JWT-Token string

type OpenPearl

type OpenPearl struct {
	Closed  Pearl
	Payload []byte
	Claim   PearlClaim
}

func Open

func Open(pks []*key.PrivateKey, pea *Pearl) (*OpenPearl, error)

Close creates a pearl with the EncryptedPayload and Owners

func OpenOne

func OpenOne(pk *key.PrivateKey, pea *Pearl) (*OpenPearl, error)

type Pearl

type Pearl struct {
	FingerPrint []byte
	Type        string
	Payload     []byte
	Owners      CreatorOwners
}

Pearl describes an Pearl which is part of an Necklace

func Close

func Close(opa *CloseRequestPearl) (*Pearl, error)

Close a pearl with the EncryptedPayload and Owners

func (*Pearl) AsJSON

func (p *Pearl) AsJSON() *JSONPearl

AsJSON converts a Pearl to a JSONPearl

type PearlClaim

type PearlClaim struct {
	PayloadChecksum          string `json:"pcs"`
	EncryptedPayloadPassword string `json:"epp"`
	jwt.StandardClaims
}

PearlClaim is the enhanced structure to the jwt.StandardClaims

type PearlOwner

type PearlOwner struct {
	Signer *key.PrivateKey
	Owners []*key.PublicKey
}

Jump to

Keyboard shortcuts

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