Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultExpires(role string) time.Time
- type FileMeta
- type Files
- type Hashes
- type HexBytes
- type Key
- type KeyValue
- type Role
- type Root
- type Signature
- type Signed
- type Snapshot
- type SnapshotFileMeta
- type SnapshotFiles
- type TargetFileMeta
- type TargetFiles
- type Targets
- type Timestamp
- type TimestampFileMeta
- type TimestampFiles
Constants ¶
View Source
const ( KeyIDLength = sha256.Size * 2 KeyTypeEd25519 = "ed25519" KeyTypeECDSA_SHA2_P256 = "ecdsa-sha2-nistp256" KeySchemeEd25519 = "ed25519" KeySchemeECDSA_SHA2_P256 = "ecdsa-sha2-nistp256" )
Variables ¶
View Source
var (
KeyAlgorithms = []string{"sha256", "sha512"}
)
Functions ¶
func DefaultExpires ¶
Types ¶
type FileMeta ¶
type FileMeta struct {
Length int64 `json:"length",omitempty`
Hashes Hashes `json:"hashes",ompitempty`
Custom *json.RawMessage `json:"custom,omitempty"`
}
func (FileMeta) HashAlgorithms ¶
type Key ¶
type Key struct {
Type string `json:"keytype"`
Scheme string `json:"scheme,omitempty"`
Algorithms []string `json:"keyid_hash_algorithms,omitempty"`
Value KeyValue `json:"keyval"`
// contains filtered or unexported fields
}
func (*Key) ContainsID ¶
type Root ¶
type Root struct {
Type string `json:"_type"`
SpecVersion string `json:"spec_version"`
Version int `json:"version"`
Expires time.Time `json:"expires"`
Keys map[string]*Key `json:"keys"`
Roles map[string]*Role `json:"roles"`
ConsistentSnapshot bool `json:"consistent_snapshot"`
}
func (Root) UniqueKeys ¶
UniqueKeys returns the unique keys for each associated role. We might have multiple key IDs that correspond to the same key.
type Signed ¶
type Signed struct {
Signed json.RawMessage `json:"signed"`
Signatures []Signature `json:"signatures"`
}
type Snapshot ¶
type Snapshot struct {
Type string `json:"_type"`
SpecVersion string `json:"spec_version"`
Version int `json:"version"`
Expires time.Time `json:"expires"`
Meta SnapshotFiles `json:"meta"`
}
func NewSnapshot ¶
func NewSnapshot() *Snapshot
type SnapshotFileMeta ¶
type SnapshotFiles ¶
type SnapshotFiles map[string]SnapshotFileMeta
type TargetFileMeta ¶
type TargetFileMeta struct {
FileMeta
}
func (TargetFileMeta) HashAlgorithms ¶
func (f TargetFileMeta) HashAlgorithms() []string
type TargetFiles ¶
type TargetFiles map[string]TargetFileMeta
type Targets ¶
type Targets struct {
Type string `json:"_type"`
SpecVersion string `json:"spec_version"`
Version int `json:"version"`
Expires time.Time `json:"expires"`
Targets TargetFiles `json:"targets"`
}
func NewTargets ¶
func NewTargets() *Targets
type Timestamp ¶
type Timestamp struct {
Type string `json:"_type"`
SpecVersion string `json:"spec_version"`
Version int `json:"version"`
Expires time.Time `json:"expires"`
Meta TimestampFiles `json:"meta"`
}
func NewTimestamp ¶
func NewTimestamp() *Timestamp
type TimestampFileMeta ¶
type TimestampFiles ¶
type TimestampFiles map[string]TimestampFileMeta
Click to show internal directories.
Click to hide internal directories.