1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00

support organization in TLS cert gen

This commit is contained in:
Darien Raymond 2018-04-12 21:43:05 +02:00
parent 290848cf4c
commit 0e1d2a924b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -78,6 +78,12 @@ func KeyUsage(usage x509.KeyUsage) Option {
} }
} }
func Organization(org string) Option {
return func(c *x509.Certificate) {
c.Subject.Organization = []string{org}
}
}
func MustGenerate(parent *Certificate, opts ...Option) *Certificate { func MustGenerate(parent *Certificate, opts ...Option) *Certificate {
cert, err := Generate(parent, opts...) cert, err := Generate(parent, opts...)
common.Must(err) common.Must(err)