| 1 | package testscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/" |
| 5 | "cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/" |
| 6 | "crypto/ecdsascip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/" |
| 7 | "crypto/ellipticscip-go gomod github.com/golang/go/src go1.24.0 `crypto/elliptic`/" |
| 8 | "crypto/randscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/" |
| 9 | "crypto/x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/" |
| 10 | "crypto/x509/pkixscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/" |
| 11 | "fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/" |
| 12 | "math/bigscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/" |
| 13 | "net/urlscip-go gomod github.com/golang/go/src go1.24.0 `net/url`/" |
| 14 | "testingscip-go gomod github.com/golang/go/src go1.24.0 testing/" |
| 15 | "timescip-go gomod github.com/golang/go/src go1.24.0 time/" |
| 16 | |
| 17 | "github.com/spiffe/go-spiffe/v2/bundle/spiffebundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/" |
| 18 | "github.com/spiffe/go-spiffe/v2/bundle/x509bundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/x509bundle`/" |
| 19 | "github.com/spiffe/go-spiffe/v2/spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/" |
| 20 | "github.com/spiffe/go-spiffe/v2/svid/x509svidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/" |
| 21 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 22 | ) |
| 23 | |
| 24 | type CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA# struct { |
| 25 | tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb. testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB# |
| 26 | tdscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#td. spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/.TrustDomainscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/TrustDomain# |
| 27 | parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent. *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA# |
| 28 | certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert. *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate# |
| 29 | keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key. cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer# |
| 30 | jwtKeyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKey. cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer# |
| 31 | jwtKidscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKid. string |
| 32 | } |
| 33 | |
| 34 | type CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption# interface { |
| 35 | applyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#apply.(*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) |
| 36 | } |
| 37 | |
| 38 | type certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption# func(*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) |
| 39 | |
| 40 | func (co certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#) applyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#apply().(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) { |
| 41 | co(c) |
| 42 | } |
| 43 | |
| 44 | // NewEC256Key returns an ECDSA key over the P256 curve |
| 45 | func NewEC256Keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewEC256Key().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#) *ecdsascip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/.PrivateKeyscip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/PrivateKey# { |
| 46 | key, err := ecdsascip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/.GenerateKeyscip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/GenerateKey().(ellipticscip-go gomod github.com/golang/go/src go1.24.0 `crypto/elliptic`/.P256scip-go gomod github.com/golang/go/src go1.24.0 `crypto/elliptic`/P256().(), randscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/.Readerscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/Reader.) |
| 47 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(tb, err) |
| 48 | return key |
| 49 | } |
| 50 | |
| 51 | // NewKeyID returns a random id useful for identifying keys |
| 52 | func NewKeyIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewKeyID().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#) string { |
| 53 | choices := make([]byte, 32) |
| 54 | _, err := randscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/.Readscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/Read().(choices) |
| 55 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(tb, err) |
| 56 | return keyIDFromBytesscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/keyIDFromBytes().(choices) |
| 57 | } |
| 58 | |
| 59 | func keyIDFromBytesscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/keyIDFromBytes().(choices []byte) string { |
| 60 | const alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| 61 | buf := new(bytesscip-go gomod github.com/golang/go/src go1.24.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#) |
| 62 | for _, choice := range choices { |
| 63 | buf.WriteBytescip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#WriteByte().(alphabet[int(choice)%len(alphabet)]) |
| 64 | } |
| 65 | return buf.Stringscip-go gomod github.com/golang/go/src go1.24.0 bytes/Buffer#String().() |
| 66 | } |
| 67 | |
| 68 | func NewCAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewCA().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#, td spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/.TrustDomainscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/TrustDomain#) *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA# { |
| 69 | cert, key := CreateCACertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCACertificate().(tb, nil, nil) |
| 70 | return &CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#{ |
| 71 | tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb.: tb, |
| 72 | tdscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#td.: td, |
| 73 | certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert.: cert, |
| 74 | keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key.: key, |
| 75 | jwtKeyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKey.: NewEC256Keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewEC256Key().(tb), |
| 76 | jwtKidscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKid.: NewKeyIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewKeyID().(tb), |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) ChildCAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#ChildCA().(options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA# { |
| 81 | cert, key := CreateCACertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCACertificate().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb., ca.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert., ca.keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key., options...) |
| 82 | return &CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#{ |
| 83 | tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb.: ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb., |
| 84 | parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent.: ca, |
| 85 | certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert.: cert, |
| 86 | keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key.: key, |
| 87 | jwtKeyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKey.: NewEC256Keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewEC256Key().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb.), |
| 88 | jwtKidscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#jwtKid.: NewKeyIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewKeyID().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb.), |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) CreateX509SVIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#CreateX509SVID().(id spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/.IDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/ID#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) *x509svidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/.SVIDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID# { |
| 93 | cert, key := CreateX509SVIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509SVID().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb., ca.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert., ca.keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key., id, options...) |
| 94 | return &x509svidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/.SVIDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#{ |
| 95 | IDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#ID.: id, |
| 96 | Certificatesscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#Certificates.: append([]*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{cert}, ca.chainscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#chain().(false)...), |
| 97 | PrivateKeyscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#PrivateKey.: key, |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) CreateX509SVIDNoPrivateKeyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#CreateX509SVIDNoPrivateKey().(id spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/.IDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/ID#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) *x509svidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/.SVIDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID# { |
| 102 | cert, _ := CreateX509SVIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509SVID().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb., ca.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert., ca.keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key., id, options...) |
| 103 | return &x509svidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/.SVIDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#{ |
| 104 | IDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#ID.: id, |
| 105 | Certificatesscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/svid/x509svid`/SVID#Certificates.: append([]*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{cert}, ca.chainscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#chain().(false)...), |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) CreateX509Certificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#CreateX509Certificate().(options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) ([]*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#) { |
| 110 | cert, key := CreateX509Certificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509Certificate().(ca.tbscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#tb., ca.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert., ca.keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#key., options...) |
| 111 | return append([]*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{cert}, ca.chainscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#chain().(false)...), key |
| 112 | } |
| 113 | |
| 114 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) X509Authoritiesscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#X509Authorities().() []*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate# { |
| 115 | root := ca |
| 116 | for root.parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent. != nil { |
| 117 | root = root.parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent. |
| 118 | } |
| 119 | return []*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{root.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert.} |
| 120 | } |
| 121 | |
| 122 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) Bundlescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#Bundle().() *spiffebundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/.Bundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/Bundle# { |
| 123 | bundle := spiffebundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/.Newscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/New().(ca.tdscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#td.) |
| 124 | bundle.SetX509Authoritiesscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/spiffebundle`/Bundle#SetX509Authorities().(ca.X509Authoritiesscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#X509Authorities().()) |
| 125 | return bundle |
| 126 | } |
| 127 | |
| 128 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) X509Bundlescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#X509Bundle().() *x509bundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/x509bundle`/.Bundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/x509bundle`/Bundle# { |
| 129 | return x509bundlescip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/x509bundle`/.FromX509Authoritiesscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/bundle/x509bundle`/FromX509Authorities().(ca.tdscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#td., ca.X509Authoritiesscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#X509Authorities().()) |
| 130 | } |
| 131 | |
| 132 | func CreateCACertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCACertificate().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#, parent *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, parentKey cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) (*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#) { |
| 133 | now := timescip-go gomod github.com/golang/go/src go1.24.0 time/.Nowscip-go gomod github.com/golang/go/src go1.24.0 time/Now().() |
| 134 | serial := NewSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewSerial().(tb) |
| 135 | key := NewEC256Keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewEC256Key().(tb) |
| 136 | tmpl := &x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{ |
| 137 | SerialNumberscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#SerialNumber.: serial, |
| 138 | Subjectscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#Subject.: pkixscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/.Namescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#{ |
| 139 | CommonNamescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#CommonName.: fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("CA %x", serial), |
| 140 | }, |
| 141 | BasicConstraintsValidscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#BasicConstraintsValid.: true, |
| 142 | IsCAscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#IsCA.: true, |
| 143 | NotBeforescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#NotBefore.: now, |
| 144 | NotAfterscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#NotAfter.: now.Addscip-go gomod github.com/golang/go/src go1.24.0 time/Time#Add().(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Hourscip-go gomod github.com/golang/go/src go1.24.0 time/Hour.), |
| 145 | } |
| 146 | |
| 147 | applyOptionsscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/applyOptions().(tmpl, options...) |
| 148 | |
| 149 | if parent == nil { |
| 150 | parent = tmpl |
| 151 | parentKey = key |
| 152 | } |
| 153 | return CreateCertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCertificate().(tb, tmpl, parent, key.Publicscip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/PrivateKey#Public().(), parentKey), key |
| 154 | } |
| 155 | |
| 156 | func CreateX509Certificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509Certificate().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#, parent *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, parentKey cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) (*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#) { |
| 157 | now := timescip-go gomod github.com/golang/go/src go1.24.0 time/.Nowscip-go gomod github.com/golang/go/src go1.24.0 time/Now().() |
| 158 | serial := NewSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewSerial().(tb) |
| 159 | key := NewEC256Keyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewEC256Key().(tb) |
| 160 | tmpl := &x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{ |
| 161 | SerialNumberscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#SerialNumber.: serial, |
| 162 | Subjectscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#Subject.: pkixscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/.Namescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#{ |
| 163 | CommonNamescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#CommonName.: fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("X509-Certificate %x", serial), |
| 164 | }, |
| 165 | NotBeforescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#NotBefore.: now, |
| 166 | NotAfterscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#NotAfter.: now.Addscip-go gomod github.com/golang/go/src go1.24.0 time/Time#Add().(timescip-go gomod github.com/golang/go/src go1.24.0 time/.Hourscip-go gomod github.com/golang/go/src go1.24.0 time/Hour.), |
| 167 | KeyUsagescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#KeyUsage.: x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.KeyUsageDigitalSignaturescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/KeyUsageDigitalSignature., |
| 168 | } |
| 169 | |
| 170 | applyOptionsscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/applyOptions().(tmpl, options...) |
| 171 | |
| 172 | return CreateCertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCertificate().(tb, tmpl, parent, key.Publicscip-go gomod github.com/golang/go/src go1.24.0 `crypto/ecdsa`/PrivateKey#Public().(), parentKey), key |
| 173 | } |
| 174 | |
| 175 | func CreateX509SVIDscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509SVID().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#, parent *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, parentKey cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#, id spiffeidscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/.IDscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/ID#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) (*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, cryptoscip-go gomod github.com/golang/go/src go1.24.0 crypto/.Signerscip-go gomod github.com/golang/go/src go1.24.0 crypto/Signer#) { |
| 176 | serial := NewSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewSerial().(tb) |
| 177 | options = append(options, |
| 178 | WithSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithSerial().(serial), |
| 179 | WithKeyUsagescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithKeyUsage().(x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.KeyUsageDigitalSignaturescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/KeyUsageDigitalSignature.), |
| 180 | WithSubjectscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithSubject().(pkixscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/.Namescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#{ |
| 181 | CommonNamescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#CommonName.: fmtscip-go gomod github.com/golang/go/src go1.24.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.0 fmt/Sprintf().("X509-SVID %x", serial), |
| 182 | }), |
| 183 | WithURIsscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithURIs().(id.URLscip-go gomod github.com/spiffe/go-spiffe/v2 v2.6.0 `github.com/spiffe/go-spiffe/v2/spiffeid`/ID#URL().())) |
| 184 | |
| 185 | return CreateX509Certificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateX509Certificate().(tb, parent, parentKey, options...) |
| 186 | } |
| 187 | |
| 188 | func CreateCertificatescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CreateCertificate().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#, tmpl, parent *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, pub, priv interface{}) *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate# { |
| 189 | certDER, err := x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.CreateCertificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/CreateCertificate().(randscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/.Readerscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/Reader., tmpl, parent, pub, priv) |
| 190 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(tb, err) |
| 191 | cert, err := x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.ParseCertificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/ParseCertificate().(certDER) |
| 192 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(tb, err) |
| 193 | return cert |
| 194 | } |
| 195 | |
| 196 | func NewSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/NewSerial().(tb testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.TBscip-go gomod github.com/golang/go/src go1.24.0 testing/TB#) *bigscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/Int# { |
| 197 | b := make([]byte, 8) |
| 198 | _, err := randscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/.Readscip-go gomod github.com/golang/go/src go1.24.0 `crypto/rand`/Read().(b) |
| 199 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(tb, err) |
| 200 | return new(bigscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/Int#).SetBytesscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/Int#SetBytes().(b) |
| 201 | } |
| 202 | |
| 203 | func WithSerialscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithSerial().(serial *bigscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/.Intscip-go gomod github.com/golang/go/src go1.24.0 `math/big`/Int#) CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption# { |
| 204 | return certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#(func(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) { |
| 205 | c.SerialNumberscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#SerialNumber. = serial |
| 206 | }) |
| 207 | } |
| 208 | |
| 209 | func WithKeyUsagescip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithKeyUsage().(keyUsage x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.KeyUsagescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/KeyUsage#) CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption# { |
| 210 | return certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#(func(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) { |
| 211 | c.KeyUsagescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#KeyUsage. = keyUsage |
| 212 | }) |
| 213 | } |
| 214 | |
| 215 | func WithURIsscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithURIs().(uris ...*urlscip-go gomod github.com/golang/go/src go1.24.0 `net/url`/.URLscip-go gomod github.com/golang/go/src go1.24.0 `net/url`/URL#) CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption# { |
| 216 | return certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#(func(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) { |
| 217 | c.URIsscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#URIs. = uris |
| 218 | }) |
| 219 | } |
| 220 | |
| 221 | func WithSubjectscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/WithSubject().(subject pkixscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/.Namescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509/pkix`/Name#) CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption# { |
| 222 | return certificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/certificateOption#(func(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#) { |
| 223 | c.Subjectscip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#Subject. = subject |
| 224 | }) |
| 225 | } |
| 226 | |
| 227 | func applyOptionsscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/applyOptions().(c *x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#, options ...CertificateOptionscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#) { |
| 228 | for _, opt := range options { |
| 229 | opt.applyscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CertificateOption#apply.(c) |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | func (ca *CAscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#) chainscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#chain().(includeRoot bool) []*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate# { |
| 234 | chain := []*x509scip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/.Certificatescip-go gomod github.com/golang/go/src go1.24.0 `crypto/x509`/Certificate#{} |
| 235 | next := ca |
| 236 | for next != nil { |
| 237 | if includeRoot || next.parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent. != nil { |
| 238 | chain = append(chain, next.certscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#cert.) |
| 239 | } |
| 240 | next = next.parentscip-go gomod github.com/in-toto/in-toto-golang . `github.com/in-toto/in-toto-golang/internal/test`/CA#parent. |
| 241 | } |
| 242 | return chain |
| 243 | } |