aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2015-01-14 21:42:37 +0100
committerGibheer <gibheer@gmail.com>2015-01-14 21:42:37 +0100
commit73a07e7665ceb5ea35b33091e286774e4f5ab04e (patch)
tree0b8a65ea11ccdc9d050afdd06da5df05fb498846 /main.go
parent0a7c8b863bee1572b90ca5d0a037efd1c6bcd54f (diff)
add api for public keys
This enables pkictl to generate public keys from private keys in the rsa and ecdsa format.
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.go b/main.go
index bbb7caa..8329d47 100644
--- a/main.go
+++ b/main.go
@@ -13,6 +13,7 @@ const (
TypeLabelRSA = "RSA PRIVATE KEY"
TypeLabelECDSA = "EC PRIVATE KEY"
TypeLabelCSR = "CERTIFICATE REQUEST"
+ TypeLabelPubKey = "PUBLIC KEY"
)
var (
@@ -24,11 +25,13 @@ func main() {
crash_with_help(1, "No module selected!")
}
switch os.Args[1] {
- case "create-private": create_private_key()
+ case "create-private": create_private_key()
case "create-cert-sign": create_sign_request()
+ case "create-public": create_public_key()
case "help": print_modules()
case "info": info_on_file()
- case "sign": sign_request()
+ case "sign-request": sign_request()
+ case "sign-input": sign_input()
default: crash_with_help(1, "Command not supported!")
}
}
@@ -37,6 +40,8 @@ func main() {
func info_on_file() {}
// sign a certificate request to create a new certificate
func sign_request() {}
+// sign a message with a private key
+func sign_input() {}
// open stream for given path
func open_output_stream(path string) (io.WriteCloser, error) {
@@ -57,6 +62,7 @@ func print_modules() {
fmt.Printf(`Usage: %s command args
where 'command' is one of:
create-private create a new private key
+ create-public create a public key from a private one
create-cert-sign create a new certificate sign request
help show this help
info get info on a file