Documentation
¶
Overview ¶
Package model is a model abstraction of health authorities.
Index ¶
- type HealthAuthority
- type HealthAuthorityKey
- func (k *HealthAuthorityKey) FormattedFromTime() string
- func (k *HealthAuthorityKey) FormattedThruTime() string
- func (k *HealthAuthorityKey) FromHTMLDate() string
- func (k *HealthAuthorityKey) FromHTMLTime() string
- func (k *HealthAuthorityKey) IsFuture() bool
- func (k *HealthAuthorityKey) IsValid() bool
- func (k *HealthAuthorityKey) IsValidAt(t time.Time) bool
- func (k *HealthAuthorityKey) PublicKey() (*ecdsa.PublicKey, error)
- func (k *HealthAuthorityKey) ThruHTMLDate() string
- func (k *HealthAuthorityKey) ThruHTMLTime() string
- func (k *HealthAuthorityKey) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthAuthority ¶
type HealthAuthority struct {
ID int64
Issuer string
Audience string
Name string
Keys []*HealthAuthorityKey
}
HealthAuthority represents a public health authority that is authorized to issue diagnosis verification certificates accepted by this server.
func (*HealthAuthority) Validate ¶
func (ha *HealthAuthority) Validate() error
Validate returns an error if the HealthAuthority struct is not valid.
type HealthAuthorityKey ¶
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 ¶
func (k *HealthAuthorityKey) FormattedFromTime() string
func (*HealthAuthorityKey) FormattedThruTime ¶
func (k *HealthAuthorityKey) FormattedThruTime() string
func (*HealthAuthorityKey) FromHTMLDate ¶
func (k *HealthAuthorityKey) FromHTMLDate() string
func (*HealthAuthorityKey) FromHTMLTime ¶
func (k *HealthAuthorityKey) FromHTMLTime() string
func (*HealthAuthorityKey) IsFuture ¶
func (k *HealthAuthorityKey) IsFuture() bool
func (*HealthAuthorityKey) IsValid ¶
func (k *HealthAuthorityKey) IsValid() bool
IsValid returns true if the key is valid based on the current time.
func (*HealthAuthorityKey) IsValidAt ¶
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 ¶
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) ThruHTMLDate ¶
func (k *HealthAuthorityKey) ThruHTMLDate() string
func (*HealthAuthorityKey) ThruHTMLTime ¶
func (k *HealthAuthorityKey) ThruHTMLTime() string
func (*HealthAuthorityKey) Validate ¶
func (k *HealthAuthorityKey) Validate() error
Validate returns an error if the HealthAuthorityKey is not valid.