object

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicKey

func PublicKey() keys.PublicKey

PublicKey returns a public key with a freshly generated public key and valid content

Types

type Certificate

type Certificate struct {
	Type     ProtocolType
	Usage    CertificateUsage
	HashAlgo algorithmTypes.Hash
	Data     []byte
}

Certificate contains a certificate and its meta data (type, usage and hash algorithm identifier)

func (Certificate) CompareTo

func (c Certificate) CompareTo(cert Certificate) int

CompareTo compares two certificateObject objects and returns 0 if they are equal, 1 if c is greater than cert and -1 if c is smaller than cert

func (Certificate) String

func (c Certificate) String() string

String implements Stringer interface

type CertificateUsage

type CertificateUsage int

CertificateUsage is an identifier for a certificate usage. The ID is chosen according to the RAINS Protocol Specification.

const (
	CUTrustAnchor CertificateUsage = 2
	CUEndEntity   CertificateUsage = 3
)

func (CertificateUsage) String

func (i CertificateUsage) String() string

type Name

type Name struct {
	Name string
	//Types for which the Name is valid
	Types []Type
}

Name contains a name associated with a name as an alias. Types specifies for which object connection the alias is valid

func (Name) CompareTo

func (n Name) CompareTo(nameObj Name) int

CompareTo compares two nameObjects and returns 0 if they are equal, 1 if n is greater than nameObject and -1 if n is smaller than nameObject

type NamesetExpr

type NamesetExpr string

NamesetExpr encodes a modified POSIX Extended Regular Expression format

type Object

type Object struct {
	Type  Type
	Value interface{}
}

Object contains a Value of to the specified Type

func AllObjects

func AllObjects() []Object

AllObjects returns all objects with valid content

func CertificateObject

func CertificateObject() Object

Certificate returns a certificate object with valid content

func NameObject

func NameObject() Object

NameObject returns a name object with valid content

func ServiceObject

func ServiceObject() Object

ServiceObject returns a service information object with valid content

func SortedObjects

func SortedObjects() []Object

func (Object) CompareTo

func (o Object) CompareTo(object Object) int

CompareTo compares two objects and returns 0 if they are equal, 1 if o is greater than object and -1 if o is smaller than object

func (Object) MarshalCBOR

func (obj Object) MarshalCBOR(w *cbor.CBORWriter) error

MarshalCBOR implements a CBORMarshaler.

func (*Object) Sort

func (o *Object) Sort()

Sort sorts the content of o lexicographically.

func (Object) String

func (o Object) String() string

String implements Stringer interface

func (*Object) UnmarshalArray

func (obj *Object) UnmarshalArray(in []interface{}) error

UnmarshalArray takes in a CBOR decoded array and populates the object.

type ProtocolType

type ProtocolType int

ProtocolType is an identifier for a protocol. The ID is chosen according to the RAINS Protocol Specification.

const (
	PTUnspecified ProtocolType = 0
	PTTLS         ProtocolType = 1
)

func (ProtocolType) String

func (i ProtocolType) String() string

type SCIONAddress

type SCIONAddress struct {
	IA addr.IA
	IP net.IP
}

func ParseSCIONAddress

func ParseSCIONAddress(address string) (*SCIONAddress, error)

func SCIONAddressFromRaw

func SCIONAddressFromRaw(buf []byte) (*SCIONAddress, error)

func (*SCIONAddress) Pack

func (a *SCIONAddress) Pack() []byte

func (*SCIONAddress) String

func (sa *SCIONAddress) String() string

type ServiceInfo

type ServiceInfo struct {
	Name     string
	Port     uint16
	Priority uint
}

ServiceInfo contains information how to access a named service

func (ServiceInfo) CompareTo

func (s ServiceInfo) CompareTo(serviceInfo ServiceInfo) int

CompareTo compares two serviceInfo objects and returns 0 if they are equal, 1 if s is greater than serviceInfo and -1 if s is smaller than serviceInfo

type Type

type Type int

Type identifier for object connection. ID chosen according to RAINS Protocol Specification

const (
	OTName        Type = 1
	OTIP6Addr     Type = 2
	OTIP4Addr     Type = 3
	OTRedirection Type = 4
	OTDelegation  Type = 5
	OTNameset     Type = 6
	OTCertInfo    Type = 7
	OTServiceInfo Type = 8
	OTRegistrar   Type = 9
	OTRegistrant  Type = 10
	OTInfraKey    Type = 11
	OTExtraKey    Type = 12
	OTNextKey     Type = 13
	OTScionAddr   Type = 14
)

func AllTypes

func AllTypes() []Type

AllTypes returns all object types.

func ParseTypes

func ParseTypes(qType string) ([]Type, error)

ParseTypes returns the object type(s) specified in qType

func (Type) CLIString

func (t Type) CLIString() string

TypeString returns the CLI type string corresponding to the object type specified in qType

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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