anchor

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

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

Anchor is the metadata associated with an attribute. It describes how an attribute has been provided to Yoti (SOURCE Anchor) and how it has been verified (VERIFIER Anchor). If an attribute has only one SOURCE Anchor with the value set to "USER_PROVIDED" and zero VERIFIER Anchors, then the attribute is a self-certified one.

func GetSources

func GetSources(anchors []*Anchor) (sources []*Anchor)

GetSources returns the anchors which identify how and when an attribute value was acquired.

func GetVerifiers

func GetVerifiers(anchors []*Anchor) (sources []*Anchor)

GetVerifiers returns the anchors which identify how and when an attribute value was verified by another provider.

func ParseAnchors

func ParseAnchors(protoAnchors []*yotiprotoattr.Anchor) []*Anchor

ParseAnchors takes a slice of protobuf anchors, parses them, and returns a slice of Yoti SDK Anchors

func (Anchor) OriginServerCerts

func (a Anchor) OriginServerCerts() []*x509.Certificate

OriginServerCerts are the X.509 certificate chain(DER-encoded ASN.1) from the service that assigned the attribute.

The first certificate in the chain holds the public key that can be used to verify the Signature field; any following entries (zero or more) are for intermediate certificate authorities (in order).

The last certificate in the chain must be verified against the Yoti root CA certificate. An extension in the first certificate holds the main artifact type, e.g. “PASSPORT”, which can be retrieved with .Value().

func (Anchor) SignedTimestamp

func (a Anchor) SignedTimestamp() SignedTimestamp

SignedTimestamp is the time at which the signature was created. The message associated with the timestamp is the marshaled form of AttributeSigning (i.e. the same message that is signed in the Signature field). This method returns the SignedTimestamp object, the actual timestamp as a *time.Time can be called with .Timestamp() on the result of this function.

func (Anchor) SubType

func (a Anchor) SubType() string

SubType is an indicator of any specific processing method, or subcategory, pertaining to an artifact. For example, for a passport, this would be either "NFC" or "OCR".

func (Anchor) Type

func (a Anchor) Type() Type

Type of the Anchor - most likely either SOURCE or VERIFIER, but it's possible that new Anchor types will be added in future.

func (Anchor) Value

func (a Anchor) Value() []string

Value identifies the provider that either sourced or verified the attribute value. The range of possible values is not limited. For a SOURCE anchor, expect values like PASSPORT, DRIVING_LICENSE. For a VERIFIER anchor expect valuues like YOTI_ADMIN.

type SignedTimestamp

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

SignedTimestamp is the object which contains a timestamp

func (SignedTimestamp) Timestamp

func (s SignedTimestamp) Timestamp() *time.Time

Timestamp is a point in time, to the nearest microsecond.

func (SignedTimestamp) Version

func (s SignedTimestamp) Version() int32

Version indicates both the version of the protobuf message in use, as well as the specific hash algorithms.

type Type

type Type int

Type Anchor type, based on the Object Identifier (OID)

const (
	// AnchorTypeUnknown - default value
	AnchorTypeUnknown Type = 1 + iota
	// AnchorTypeSource - how the anchor has been sourced
	AnchorTypeSource
	// AnchorTypeVerifier - how the anchor has been verified
	AnchorTypeVerifier
)

Jump to

Keyboard shortcuts

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