ToStoreTLSData converts TLSData to the store representation
()
| 23 | |
| 24 | // ToStoreTLSData converts TLSData to the store representation |
| 25 | func (data *TLSData) ToStoreTLSData() *store.EndpointTLSData { |
| 26 | if data == nil { |
| 27 | return nil |
| 28 | } |
| 29 | result := store.EndpointTLSData{ |
| 30 | Files: make(map[string][]byte), |
| 31 | } |
| 32 | if data.CA != nil { |
| 33 | result.Files[caKey] = data.CA |
| 34 | } |
| 35 | if data.Cert != nil { |
| 36 | result.Files[certKey] = data.Cert |
| 37 | } |
| 38 | if data.Key != nil { |
| 39 | result.Files[keyKey] = data.Key |
| 40 | } |
| 41 | return &result |
| 42 | } |
| 43 | |
| 44 | // LoadTLSData loads TLS data from the store |
| 45 | func LoadTLSData(s store.Reader, contextName, endpointName string) (*TLSData, error) { |
no outgoing calls
no test coverage detected