core: v2ray.com/core/common/protocol/tls/cert Index | Files

package cert

import "v2ray.com/core/common/protocol/tls/cert"

Index

Package Files

cert.go errors.generated.go

type Certificate Uses

type Certificate struct {
    // Cerificate in ASN.1 DER format
    Certificate []byte
    // Private key in ASN.1 DER format
    PrivateKey []byte
}

func Generate Uses

func Generate(parent *Certificate, opts ...Option) (*Certificate, error)

func MustGenerate Uses

func MustGenerate(parent *Certificate, opts ...Option) *Certificate

func ParseCertificate Uses

func ParseCertificate(certPEM []byte, keyPEM []byte) (*Certificate, error)

func (*Certificate) ToPEM Uses

func (c *Certificate) ToPEM() ([]byte, []byte)

type Option Uses

type Option func(*x509.Certificate)

func Authority Uses

func Authority(isCA bool) Option

func CommonName Uses

func CommonName(name string) Option

func DNSNames Uses

func DNSNames(names ...string) Option

func KeyUsage Uses

func KeyUsage(usage x509.KeyUsage) Option

func NotAfter Uses

func NotAfter(t time.Time) Option

func NotBefore Uses

func NotBefore(t time.Time) Option

func Organization Uses

func Organization(org string) Option

Package cert imports 8 packages (graph) and is imported by 7 packages. Updated 2019-03-27. Refresh now. Tools for package owners.