scion-pki: Improve help message
Clarify the predecessor flag for scion-pki trcs payload.
GitOrigin-RevId:
@@ -40,10 +40,14 @@ func newPayload(pather command.Pather) *cobra.Command {
cmd := &cobra.Command{
Use: "payload",
Short: "Generate new TRC payload",
- Example: fmt.Sprintf(` %[1]s payload -t template.toml -o payload.der`,
+ Example: fmt.Sprintf(` %[1]s payload -t template.toml -o payload.der
+ %[1]s payload -t template.toml -o payload.der -p predecessor.trc
+ `,
pather.CommandPath()),
Long: `'payload' creates the asn.1 encoded der file.
+To update an existing TRC the predecessor TRC needs to be specified.
+
To inspect the created asn.1 file you can use the openssl tool:
openssl asn1parse -inform DER -i -in payload.der
(for more information see 'man asn1parse')
@@ -99,6 +103,10 @@ func loadPredecessor(base bool, pred string) (*cppki.TRC, error) {
fmt.Println("Generating payload for base TRC.")
return nil, nil
}
+ if pred == "" {
+ return nil, serrors.New("missing predecessor file." +
+ " Specify the predecessor TRC via --predecessor")
+ }
trc, err := DecodeFromFile(pred)
if err != nil {
return nil, serrors.WrapStr("loading predecessor TRC", err, "file", pred)
