(domain string, keyType int)
| 95 | } |
| 96 | |
| 97 | func (c *CertStorage) absoluteFileName(domain string, keyType int) (string, error) { |
| 98 | base := c.storageDirectory + "/" + strings.ToLower(domain) |
| 99 | |
| 100 | switch keyType { |
| 101 | case privateKey: |
| 102 | return base + ".key", nil |
| 103 | case certificate: |
| 104 | return base + ".cer", nil |
| 105 | default: |
| 106 | return "", errors.New("Unknown key type: " + strconv.Itoa(keyType)) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func (c *CertStorage) readCerts() ([]string, error) { |
| 111 | var files []string |