Thursday 16 May 2024

go lang run open ssl cmd

 package main


import (

"fmt"

"os/exec"

)


func main() {

// Command and arguments

cmd := "openssl"

args := []string{

"cms", "-verify", "-nosmimecap",

"-CAfile", "<myCAfile>",

"-in", "<mysignature>",

"-content", "<mydateFile>",

"-inform", "DER",

"-binary",

}


// Execute the command

out, err := exec.Command(cmd, args...).CombinedOutput()

if err != nil {

fmt.Printf("Error executing command: %v\nOutput: %s\n", err, out)

return

}


// Print the output

fmt.Println("Output:", string(out))

}


No comments:

Post a Comment