tls

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCertificate

func FindCertificate(crt []byte) []byte

FindCertificate finds DER block from cert

func GetPemFingerprint

func GetPemFingerprint(crt []byte) string

GetPemFingerprint returns sha1 fingerprint from cert

func SplitCerts

func SplitCerts(crt []byte) ([]byte, []byte)

SplitCerts splits cert with bundle to cert and bundle

func StripSpaces

func StripSpaces(str []byte) []byte

StripSpaces removes strip spaces from str

func ValidateCertificate

func ValidateCertificate(crt []byte) error

ValidateCertificate validates that certificate is valid

Types

type Manager

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

Manager represents a TLS manager

func NewManager

func NewManager(client *serverscom.Client, store store.Storer) *Manager

NewManager creates a new TLS manager

func (*Manager) Get

func (m *Manager) Get(fingerprint string) (*serverscom.SSLCertificate, error)

Get gets an ssl from manager

func (*Manager) GetByID added in v1.0.2

func (m *Manager) GetByID(id string) (*serverscom.SSLCertificate, error)

Get gets an ssl from API by id

func (*Manager) HasRegistration

func (m *Manager) HasRegistration(fingerprint string) bool

HasRegistration checks if TLS manager has an ssl with specified fingerprint

func (*Manager) SyncCertificate

func (m *Manager) SyncCertificate(fingerprint, name string, cert, key, chain []byte) (*serverscom.SSLCertificate, error)

SyncCertificate creates an ssl in portal and add it to manager or update it in manager it it already exists in portal

type SslCertificate

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

SslCertificate represents an ssl cert object for manager

type TLSManagerInterface

type TLSManagerInterface interface {
	HasRegistration(fingerprint string) bool
	SyncCertificate(fingerprint, name string, cert, key, chain []byte) (*serverscom.SSLCertificate, error)
	Get(fingerprint string) (*serverscom.SSLCertificate, error)
	GetByID(id string) (*serverscom.SSLCertificate, error)
}

ManagerInterface describes an interface to manage SSL certs

Jump to

Keyboard shortcuts

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