WithX5CInsecureCerts returns a Options that sets the header x5cAllowInvalid claims using the cert in memory
(certs []*x509.Certificate, key interface{})
| 339 | |
| 340 | // WithX5CInsecureCerts returns a Options that sets the header x5cAllowInvalid claims using the cert in memory |
| 341 | func 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. |
| 353 | func WithSSHPOPFile(certFile string, key interface{}) Options { |
no test coverage detected
searching dependent graphs…