certc

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SharedSubject = pkix.Name{
	Country:      []string{"US"},
	Organization: []string{"Connet"},
}

Functions

func MarshalJSONCert

func MarshalJSONCert(cert *x509.Certificate) ([]byte, error)

func SelfSigned

func SelfSigned(domain string) (tls.Certificate, *x509.CertPool, error)

func UnmarshalJSONCert

func UnmarshalJSONCert(b []byte) (*x509.Certificate, error)

Types

type Cert

type Cert struct {
	// contains filtered or unexported fields
}

func DecodeFromMemory

func DecodeFromMemory(cert, key []byte) (*Cert, error)

func FromTLS

func FromTLS(tlsCert tls.Certificate) *Cert

func NewRoot

func NewRoot() (*Cert, error)

func (*Cert) Cert

func (c *Cert) Cert() (*x509.Certificate, error)

func (*Cert) CertPool

func (c *Cert) CertPool() (*x509.CertPool, error)

func (*Cert) Encode

func (c *Cert) Encode(certOut io.Writer, keyOut io.Writer) error

func (*Cert) EncodeToMemory

func (c *Cert) EncodeToMemory() ([]byte, []byte, error)

func (*Cert) NewClient

func (c *Cert) NewClient(opts CertOpts) (*Cert, error)

func (*Cert) NewIntermediate

func (c *Cert) NewIntermediate(opts CertOpts) (*Cert, error)

func (*Cert) NewServer

func (c *Cert) NewServer(opts CertOpts) (*Cert, error)

func (*Cert) Raw

func (c *Cert) Raw() []byte

func (*Cert) TLSCert

func (c *Cert) TLSCert() (tls.Certificate, error)

type CertOpts

type CertOpts struct {
	Domains []string
	IPs     []net.IP
}

type Key

type Key struct {
	// contains filtered or unexported fields

} // TODO move to model

func NewKey

func NewKey(cert *x509.Certificate) Key

func NewKeyRaw

func NewKeyRaw(raw []byte) Key

func NewKeyString

func NewKeyString(s string) Key

func NewKeyTLS

func NewKeyTLS(cert tls.Certificate) Key

func (Key) IsValid

func (k Key) IsValid() bool

func (Key) MarshalText

func (k Key) MarshalText() ([]byte, error)

func (Key) String

func (k Key) String() string

func (*Key) UnmarshalText

func (k *Key) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL