doc.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Package transport implements functions for facilitating proper TLS-secured
  2. // communications for clients and servers.
  3. //
  4. // Clients should build an identity (of the core.identity) type, such as
  5. //
  6. // var id = &core.Identity{
  7. // Request: &csr.CertificateRequest{
  8. // CN: "localhost test certificate",
  9. // },
  10. // Profiles: map[string]map[string]string{
  11. // "paths": map[string]string{
  12. // "private_key": "client.key",
  13. // "certificate": "client.pem",
  14. // },
  15. // "cfssl": {
  16. // "label": "",
  17. // "profile": "client-ca",
  18. // "remote": "ca.example.net",
  19. // "auth-type": "standard",
  20. // "auth-key": "000102030405060708090a0b0c0d0e0f",
  21. // },
  22. // },
  23. // }
  24. //
  25. // The New function will return a transport built using the
  26. // NewKeyProvider and NewCA functions. These functions may be changed
  27. // by other packages to provide common key provider and CA
  28. // configurations. Clients can then use RefreshKeys (or launch
  29. // AutoUpdate in a goroutine) to ensure the certificate and key are
  30. // loaded and correct. The Listen and Dial functions then provide the
  31. // necessary connection support.
  32. //
  33. // The AutoUpdate function will handle automatic certificate
  34. // issuance. Servers and clients are not required to take any special
  35. // action when the certificate is updated: the key and certificate are
  36. // only used when establishing a connection, and therefore existing
  37. // connections are not affected---there is no need to reset or restart
  38. // any existing connections. Clients should run AutoUpdate if they
  39. // plan on making multiple connections or will be reconnecting; for a
  40. // one-off connection, it isn't necessary.
  41. package transport