Set parses a root rotation option
(value string)
| 140 | |
| 141 | // Set parses a root rotation option |
| 142 | func (p *PEMFile) Set(value string) error { |
| 143 | contents, err := os.ReadFile(value) |
| 144 | if err != nil { |
| 145 | return err |
| 146 | } |
| 147 | if pemBlock, _ := pem.Decode(contents); pemBlock == nil { |
| 148 | return errors.New("file contents must be in PEM format") |
| 149 | } |
| 150 | p.contents, p.path = string(contents), value |
| 151 | return nil |
| 152 | } |
| 153 | |
| 154 | // Contents returns the contents of the PEM file |
| 155 | func (p *PEMFile) Contents() string { |
no outgoing calls