Documentation
¶
Index ¶
- type AtsKey
- type AtsKeyVal
- type AtsTufRoot
- type AtsTufSnapshot
- type AtsTufTargets
- type AtsTufTimestamp
- type Hashes
- type HexBytes
- type ImportSigner
- type MetaItem
- type RoleName
- type RootMeta
- type RootRole
- type SigAlgorithm
- type Signature
- type SignedCommon
- type Signer
- type SnapshotMeta
- type TargetFileMeta
- type TargetFiles
- type TargetsMeta
- type TimestampMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtsKeyVal ¶
type AtsKeyVal struct {
Public string `json:"public,omitempty"`
Private string `json:"private,omitempty"`
}
AtsKeyVal holds the (hex encoded) public and/or private key material.
type AtsTufRoot ¶
type AtsTufRoot struct {
Signatures []Signature `json:"signatures"`
Signed RootMeta `json:"signed"`
}
AtsTufRoot is a full root.json file.
type AtsTufSnapshot ¶
type AtsTufSnapshot struct {
Signatures []Signature `json:"signatures"`
Signed SnapshotMeta `json:"signed"`
}
AtsTufSnapshot is a full snapshot.json file.
type AtsTufTargets ¶
type AtsTufTargets struct {
Signatures []Signature `json:"signatures"`
Signed TargetsMeta `json:"signed"`
}
AtsTufTargets is a full targets.json file.
func (AtsTufTargets) GetLatestTargetVersion ¶
func (t AtsTufTargets) GetLatestTargetVersion() int
type AtsTufTimestamp ¶
type AtsTufTimestamp struct {
Signatures []Signature `json:"signatures"`
Signed TimestampMeta `json:"signed"`
}
AtsTufTimestamp is a full timestamp.json file.
type HexBytes ¶
type HexBytes []byte
HexBytes is a byte slice that is hex encoded in JSON. TUF hashes use this representation (unlike signatures, which are base64 encoded).
func (HexBytes) MarshalJSON ¶
func (*HexBytes) UnmarshalJSON ¶
type ImportSigner ¶
type ImportSigner struct {
Id string
// contains filtered or unexported fields
}
ImportSigner wraps an offline private key (RSA or ed25519) imported from an external tool such as fioctl/garage-sign. It is used to co-sign a newly generated root metadata during migration so that the new root chains from the previously trusted (imported) root.
func ImportSignerFromAtsKey ¶
func ImportSignerFromAtsKey(key AtsKey) (*ImportSigner, error)
ImportSignerFromAtsKey builds an ImportSigner from a private AtsKey. Both the ota-tuf RSA (PEM PKCS#1) and ed25519 (hex) private key representations are supported.
type MetaItem ¶
type MetaItem struct {
Version int `json:"version"`
Length int64 `json:"length"`
Hashes Hashes `json:"hashes"`
}
MetaItem references a version of another metadata file. The ota-tuf format for snapshot and timestamp metadata only records the version.
type RootMeta ¶
type RootMeta struct {
SignedCommon
ConsistentSnapshot bool `json:"consistent_snapshot"`
Keys map[string]AtsKey `json:"keys"`
Roles map[RoleName]RootRole `json:"roles"`
}
RootMeta is the "signed" component of a root.json file.
type SigAlgorithm ¶
type SigAlgorithm string
SigAlgorithm is the signing method recorded in a Signature.
const ( SigEd25519 SigAlgorithm = "ed25519" SigRsaPssSha256 SigAlgorithm = "rsassa-pss-sha256" )
type Signature ¶
type Signature struct {
KeyID string `json:"keyid"`
Method SigAlgorithm `json:"method"`
Signature []byte `json:"sig"`
}
Signature is a signature over the canonical JSON of a metadata's "signed" component. The raw signature bytes are base64 encoded in JSON.
type SignedCommon ¶
type SignedCommon struct {
Type string `json:"_type"`
Expires time.Time `json:"expires"`
Version int `json:"version"`
}
SignedCommon contains the fields common to the "signed" component of all TUF metadata files.
type Signer ¶
type Signer struct {
Id string
// contains filtered or unexported fields
}
tufSigner holds a loaded private key along with its TUF key id. The server uses online ed25519 keys for all roles.
func SignerFromAtsKey ¶
SignerFromAtsKey reconstructs a signer from a stored AtsKey (private key).
func (*Signer) PrivateAtsKey ¶
privateAtsKey returns the AtsKey representation of the signer including the private key material (hex encoded seed).
func (*Signer) PublicAtsKey ¶
publicAtsKey returns the AtsKey representation of the signer with only the public key material, as embedded in root metadata.
type SnapshotMeta ¶
type SnapshotMeta struct {
SignedCommon
Meta map[string]MetaItem `json:"meta"`
}
SnapshotMeta is the "signed" component of a snapshot.json file.
type TargetFileMeta ¶
type TargetFileMeta struct {
Length int64 `json:"length"`
Hashes Hashes `json:"hashes"`
Custom json.RawMessage `json:"custom,omitempty"`
}
TargetFileMeta describes a single target file in targets metadata.
type TargetFiles ¶
type TargetFiles map[string]TargetFileMeta
TargetFiles maps a target name to its metadata.
type TargetsMeta ¶
type TargetsMeta struct {
SignedCommon
Targets TargetFiles `json:"targets"`
}
TargetsMeta is the "signed" component of a targets.json file.
type TimestampMeta ¶
type TimestampMeta struct {
SignedCommon
Meta map[string]MetaItem `json:"meta"`
}
TimestampMeta is the "signed" component of a timestamp.json file.