From 73a07e7665ceb5ea35b33091e286774e4f5ab04e Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 14 Jan 2015 21:42:37 +0100 Subject: add api for public keys This enables pkictl to generate public keys from private keys in the rsa and ecdsa format. --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main.go') 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 -- cgit v1.2.3-70-g09d2