Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var VerifyCmd = &cobra.Command{ Use: "verify", Short: "Verify the yaml", Long: `Verify the yaml. Takes yaml file, ca as args`, Run: func(cmd *cobra.Command, args []string) { if ca == "" { log.Error(errors.New("ca not provided"), "ca not provided") os.Exit(1) } var file io.ReadCloser var err error if signer.IsInputFromPipe() { file = os.Stdin } else { file, err = signer.OpenInputFile(f) if err != nil { log.Error(err, "Could not open input file") os.Exit(1) } } uobjs, err := signer.Decode(file) file.Close() if err != nil { log.Error(err, "Could not Decode input yaml contents") os.Exit(1) } caCert, err := signer.CertificateFromPemFile(ca) if err != nil { log.Error(err, "Could not retrieve ca certificate") os.Exit(1) } err = signer.VerifySignatureArray(uobjs, caCert) if err != nil { fmt.Printf("yaml failed verification") log.Error(err, "yaml failed verification") os.Exit(1) } os.Exit(0) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.