Could do this:

```go
var err error
d.keypair, err = tls.X509KeyPair(cert, key)
```