Valid checks the signature policies, ensuring they are valid policies. A policy is valid if it has defined at least key usages to be used, and a valid default profile has defined at least a default expiration.
()
| 606 | // to be used, and a valid default profile has defined at least a |
| 607 | // default expiration. |
| 608 | func (p *Signing) Valid() bool { |
| 609 | if p == nil { |
| 610 | return false |
| 611 | } |
| 612 | |
| 613 | log.Debugf("validating configuration") |
| 614 | if !p.Default.validProfile(true) { |
| 615 | log.Debugf("default profile is invalid") |
| 616 | return false |
| 617 | } |
| 618 | |
| 619 | for _, sp := range p.Profiles { |
| 620 | if !sp.validProfile(false) { |
| 621 | log.Debugf("invalid profile") |
| 622 | return false |
| 623 | } |
| 624 | } |
| 625 | |
| 626 | p.warnSkippedSettings() |
| 627 | |
| 628 | return true |
| 629 | } |
| 630 | |
| 631 | // KeyUsage contains a mapping of string names to key usages. |
| 632 | var KeyUsage = map[string]x509.KeyUsage{ |