caclient

package
v0.0.0-...-d4af9b9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorNotConfig client configuration not found
	ErrorNotConfig = 0001

	// ErrorDecodingVariable error decoding base64 variable from environment
	ErrorDecodingVariable = 1000

	// ErrorParsingP12 error parsing P12 certificate
	ErrorParsingP12 = 1001

	// ErrorLoadingP12 error loading P12 certificate
	ErrorLoadingP12 = 1002

	// ErrorParsingCaCert error parsing ca certificate
	ErrorParsingCaCert = 1003

	// ErrorLoadingCaCert error loading ca certificate
	ErrorLoadingCaCert = 1004

	// ErrorLoadingSoap error loading soap client
	ErrorLoadingSoap = 1005
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CAClient

type CAClient struct {
	Protocol TPType
	URL      string
	Client   TCom
}

CAClient CA client

func GetDefaultCAClient

func GetDefaultCAClient() (*CAClient, error)

GetDefaultCAClient get singleton for caclient

func New

func New(URL string, protocol TPType) (*CAClient, error)

New get or create CAClient

func (*CAClient) CertRequest

func (ca *CAClient) CertRequest(csr *x509.CertificateRequest, username, password string) ([]byte, error)

CertRequest send a certificate request to and CA

type ClientError

type ClientError struct {
	Code int
	// contains filtered or unexported fields
}

ClientError Ca client error

func NewError

func NewError(err string, code int) *ClientError

NewError create a new error for ca client

func (*ClientError) Error

func (e *ClientError) Error() string

type CmpTP

type CmpTP struct{}

CmpTP cmp transport protocol

func CMP

func CMP(URL string) (*CmpTP, error)

CMP create new WSDL transport protocol

type TCom

type TCom interface {
	RequestCertificate(cert *x509.CertificateRequest, deviceID string, secret string) ([]byte, error)
}

TCom methods for the transport comunication protocol

type TPProtocol

type TPProtocol interface{}

TPProtocol transport protocol

type TPType

type TPType string

TPType transport protocol type

const (
	// TPCmp transport protocol CMP
	TPCmp TPType = "cmp"

	// TPWsdl transport protocol Web service
	TPWsdl TPType = "wsdl"
)

type WsdlTP

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

WsdlTP wsdl transport protocol

func WSDL

func WSDL(URL string) (*WsdlTP, error)

WSDL create new WSDL transport protocol

func (*WsdlTP) RequestCertificate

func (w *WsdlTP) RequestCertificate(cert *x509.CertificateRequest, deviceID string, secret string) ([]byte, error)

RequestCertificate for webservice interface

Jump to

Keyboard shortcuts

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