ParseTemplateData parses the set and set-file flags and returns a json message to be used in certificate templates.
(ctx *cli.Context)
| 598 | // ParseTemplateData parses the set and set-file flags and returns a json |
| 599 | // message to be used in certificate templates. |
| 600 | func ParseTemplateData(ctx *cli.Context) (json.RawMessage, error) { |
| 601 | data, err := GetTemplateData(ctx) |
| 602 | if err != nil { |
| 603 | return nil, err |
| 604 | } |
| 605 | if len(data) == 0 { |
| 606 | return nil, nil |
| 607 | } |
| 608 | return json.Marshal(data) |
| 609 | } |
| 610 | |
| 611 | // GetTemplateData parses the set and set-file flags and returns a map to be |
| 612 | // used in certificate templates. |
searching dependent graphs…