File
Blob: spec/cipher/provider.go
| 1 | package cipher |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "crypto/tls" |
| 6 | ) |
| 7 | |
| 8 | type CertProviderFunc func(*tls.ClientHelloInfo) (*tls.Certificate, error) |
| 9 | |
| 10 | type OnHandshakeFunc func(sni string) |
| 11 | |
| 12 | type CertProvider interface { |
| 13 | Initialize(ctx context.Context) error |
| 14 | GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error) |
| 15 | GetCertificateWithContext(context.Context, *tls.ClientHelloInfo) (*tls.Certificate, error) |
| 16 | OnHandshake(OnHandshakeFunc) |
| 17 | } |