aboutsummaryrefslogtreecommitdiff
path: root/cmd/acmed/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/acmed/config.go')
-rw-r--r--cmd/acmed/config.go27
1 files changed, 23 insertions, 4 deletions
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 }