github.com/kubernetes-incubator/kube-aws@v0.16.4/pkg/api/keypair_spec.go (about) 1 package api 2 3 import ( 4 "fmt" 5 "path/filepath" 6 "time" 7 ) 8 9 type KeyPairSpec struct { 10 Name string `yaml:"name"` 11 CommonName string `yaml:"commonName"` 12 Organization string `yaml:"organization"` 13 Duration time.Duration `yaml:"duration"` 14 DNSNames []string `yaml:"dnsNames"` 15 IPAddresses []string `yaml:"ipAddresses"` 16 Usages []string `yaml:"usages"` 17 // Signer is the name of the keypair for the private key used to sign the cert 18 Signer string `yaml:"signer"` 19 } 20 21 func (spec KeyPairSpec) EncryptedKeyPath() string { 22 return fmt.Sprintf("%s.enc", spec.KeyPath()) 23 } 24 25 func (spec KeyPairSpec) KeyPath() string { 26 return filepath.Join("credentials", fmt.Sprintf("%s-key.pem", spec.Name)) 27 } 28 29 func (spec KeyPairSpec) CertPath() string { 30 return filepath.Join("credentials", fmt.Sprintf("%s.pem", spec.Name)) 31 } 32 33 func (spec KeyPairSpec) SignerCertPath() string { 34 return filepath.Join("credentials", fmt.Sprintf("%s.pem", spec.Signer)) 35 } 36 37 func (spec KeyPairSpec) SignerKeyPath() string { 38 return filepath.Join("credentials", fmt.Sprintf("%s-key.pem", spec.Signer)) 39 }