...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package remote
17
18 import (
19 "github.com/google/go-containerregistry/pkg/name"
20 v1 "github.com/google/go-containerregistry/pkg/v1"
21 "github.com/sigstore/cosign/v2/pkg/oci"
22 )
23
24
25
26
27 func SignedUnknown(digest name.Digest, options ...Option) oci.SignedEntity {
28 o := makeOptions(digest.Context(), options...)
29 return &unknown{
30 digest: digest,
31 opt: o,
32 }
33 }
34
35 type unknown struct {
36 digest name.Digest
37 opt *options
38 }
39
40 var _ oci.SignedEntity = (*unknown)(nil)
41
42
43 func (i *unknown) Digest() (v1.Hash, error) {
44 return v1.NewHash(i.digest.DigestStr())
45 }
46
47
48 func (i *unknown) Signatures() (oci.Signatures, error) {
49 return signatures(i, i.opt)
50 }
51
52
53 func (i *unknown) Attestations() (oci.Signatures, error) {
54 return attestations(i, i.opt)
55 }
56
57
58 func (i *unknown) Attachment(name string) (oci.File, error) {
59 return attachment(i, name, i.opt)
60 }
61
View as plain text