MCPcopy Create free account
hub / github.com/smallstep/cli / WithX5CInsecureCerts

Function WithX5CInsecureCerts

token/options.go:341–350  ·  view source on GitHub ↗

WithX5CInsecureCerts returns a Options that sets the header x5cAllowInvalid claims using the cert in memory

(certs []*x509.Certificate, key interface{})

Source from the content-addressed store, hash-verified

339
340// WithX5CInsecureCerts returns a Options that sets the header x5cAllowInvalid claims using the cert in memory
341func WithX5CInsecureCerts(certs []*x509.Certificate, key interface{}) Options {
342 return func(c *Claims) error {
343 certStrs, err := jose.ValidateX5C(certs, key)
344 if err != nil {
345 return errors.Wrap(err, "error validating x5c certificate chain and key for use in x5c header")
346 }
347 c.SetHeader(jose.X5cInsecureKey, certStrs)
348 return nil
349 }
350}
351
352// WithSSHPOPFile returns a Options that sets the header sshpop claims.
353func WithSSHPOPFile(certFile string, key interface{}) Options {

Callers 1

generateX5CTokenFunction · 0.92

Calls 1

SetHeaderMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…