exposure-notifications-server: github.com/google/exposure-notifications-server/internal/verification/model Index | Files

package model

import "github.com/google/exposure-notifications-server/internal/verification/model"

Package model is a model abstraction of health authorities.

Index

Package Files

health_authority.go

type HealthAuthority Uses

type HealthAuthority struct {
    ID       int64
    Issuer   string
    Audience string
    Name     string
    Keys     []*HealthAuthorityKey
    JwksURI  *string
}

HealthAuthority represents a public health authority that is authorized to issue diagnosis verification certificates accepted by this server.

func (*HealthAuthority) SetJWKS Uses

func (ha *HealthAuthority) SetJWKS(uri string)

func (*HealthAuthority) Validate Uses

func (ha *HealthAuthority) Validate() error

Validate returns an error if the HealthAuthority struct is not valid.

type HealthAuthorityKey Uses

type HealthAuthorityKey struct {
    AuthorityID  int64
    Version      string
    From         time.Time
    Thru         time.Time
    PublicKeyPEM string
}

HealthAuthorityKey represents a public key version for a given health authority.

func (*HealthAuthorityKey) FormattedFromTime Uses

func (k *HealthAuthorityKey) FormattedFromTime() string

func (*HealthAuthorityKey) FormattedThruTime Uses

func (k *HealthAuthorityKey) FormattedThruTime() string

func (*HealthAuthorityKey) FromHTMLDate Uses

func (k *HealthAuthorityKey) FromHTMLDate() string

func (*HealthAuthorityKey) FromHTMLTime Uses

func (k *HealthAuthorityKey) FromHTMLTime() string

func (*HealthAuthorityKey) IsFuture Uses

func (k *HealthAuthorityKey) IsFuture() bool

func (*HealthAuthorityKey) IsValid Uses

func (k *HealthAuthorityKey) IsValid() bool

IsValid returns true if the key is valid based on the current time.

func (*HealthAuthorityKey) IsValidAt Uses

func (k *HealthAuthorityKey) IsValidAt(t time.Time) bool

IsValidAt returns true if the key is valid at a specific point in time.

func (*HealthAuthorityKey) PublicKey Uses

func (k *HealthAuthorityKey) PublicKey() (*ecdsa.PublicKey, error)

PublicKey decodes the PublicKeyPEM text and returns the `*ecdsa.PublicKey` This system only supports verifying ECDSA JWTs, `alg: ES256`.

func (HealthAuthorityKey) Revoke Uses

func (k HealthAuthorityKey) Revoke()

Revoke revokes a key.

func (*HealthAuthorityKey) ThruHTMLDate Uses

func (k *HealthAuthorityKey) ThruHTMLDate() string

func (*HealthAuthorityKey) ThruHTMLTime Uses

func (k *HealthAuthorityKey) ThruHTMLTime() string

func (*HealthAuthorityKey) Validate Uses

func (k *HealthAuthorityKey) Validate() error

Validate returns an error if the HealthAuthorityKey is not valid.

Package model imports 6 packages (graph) and is imported by 5 packages. Updated 2020-09-27. Refresh now. Tools for package owners.