simplecertify

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 11 Imported by: 0

README

simple-ceritfy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CERTIFIER_CONFIG_PATH = "certifier.json"

Functions

func CATemplate

func CATemplate() x509.Certificate

func Save

func Save(ca *Certifier) error

func ServerTemplate

func ServerTemplate() x509.Certificate

Types

type Certifier

type Certifier struct {
	PrivateKey  *rsa.PrivateKey
	Certificate *x509.Certificate
}

func Init

func Init(template, parent *x509.Certificate) (*Certifier, error)

func Load

func Load() (*Certifier, error)

func LoadOrInit

func LoadOrInit(template, parent *x509.Certificate) (*Certifier, error)

func NewCertifier

func NewCertifier(privateKey *rsa.PrivateKey, certificate *x509.Certificate) *Certifier

func (*Certifier) Certify

func (certifier *Certifier) Certify(target *x509.Certificate) (*x509.Certificate, error)

func (*Certifier) Sign

func (certifier *Certifier) Sign(target []byte) ([]byte, error)

type CertifierConfig

type CertifierConfig struct {
	PrivateKey  []byte `json:"private_key"`
	Certificate []byte `json:"certificate"`
}

Jump to

Keyboard shortcuts

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