From 7ca19d9f729b96229ddec049b23adfc28a582aa8 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 15 Dec 2015 14:58:19 +0100 Subject: Create keys --- cmd/acmed/config.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'cmd/acmed/config.go') diff --git a/cmd/acmed/config.go b/cmd/acmed/config.go index 2e19849..4130aab 100644 --- a/cmd/acmed/config.go +++ b/cmd/acmed/config.go @@ -1,6 +1,10 @@ package main -import "github.com/BurntSushi/toml" +import ( + "crypto/rsa" + + "github.com/BurntSushi/toml" +) type Config struct { Defaults defaults @@ -16,6 +20,7 @@ type defaults struct { Provider string Account string Basedir string + KeySize int } type provider struct { @@ -23,9 +28,11 @@ type provider struct { } type account struct { - Mail string - Phone string - Key string + Mail string + Phone string + Key string + KeySize int + key *rsa.PrivateKey `toml:"-"` } type hook struct { @@ -37,9 +44,11 @@ type desire struct { Account string Altnames []string Key string + KeySize int Cert string Webroot string Hooks []string + key *rsa.PrivateKey `toml:"-"` } func LoadConfig(fname string) (*Config, error) { @@ -47,3 +56,13 @@ func LoadConfig(fname string) (*Config, error) { _, err := toml.DecodeFile(fname, c) return c, err } + +type Keychain interface { + Path() string + Size() int +} + +func (d desire) Path() string { return d.Key } +func (d desire) Size() int { return d.KeySize } +func (a account) Path() string { return a.Key } +func (a account) Size() int { return a.KeySize } -- cgit v1.2.3