ta

package
v0.0.6-0...-417b642 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR_DEFAULT_CONFIG       = "failed to read config"
	ERROR_GENERATE_RSA_KEY     = "failed to generate rsa key"
	ERROR_ATTEST_PUBLIC_KEY    = "failed to attest public key"
	ERROR_REQUEST_FAILED       = "request failed"
	ERROR_READ_BODY            = "read body failed"
	ERROR_STATUS_NOT_OK        = "status not ok"
	ERROR_VERIFIER_BASE_PARSE  = "monitor base parse failed"
	ERROR_REPOSITORY_NOT_SET   = "failed to read RA_WEBS_TA_REPOSITORY"
	ERROR_TOKEN_NOT_SET        = "failed to read RA_WEBS_SERVICE_TOKEN"
	ERROR_DOMAIN_NOT_SET       = "failed to read RA_WEBS_TA_DOMAIN"
	ERROR_EMAIL_NOT_SET        = "failed to read RA_WEBS_SERVICE_EMAIL"
	ERROR_COMMIT_ID_NOT_SET    = "failed to read RA_WEBS_TA_COMMIT_ID"
	ERROR_SERVICE_BASE_NOT_SET = "failed to read RA_WEBS_SERVICE_BASE"
)
View Source
const CERT_DIER_CACHE = "./tmp/ra-webs.cache"
View Source
const REGISTER_PATH = "/api/ta"
View Source
const WAIT = 3

Variables

Functions

func IssueCertificate

func IssueCertificate(key crypto.PrivateKey, domain, email string) *certificate.Resource

Types

type MyUser

type MyUser struct {
	Email        string
	Registration *registration.Resource
	// contains filtered or unexported fields
}

func (*MyUser) GetEmail

func (u *MyUser) GetEmail() string

func (*MyUser) GetPrivateKey

func (u *MyUser) GetPrivateKey() crypto.PrivateKey

func (MyUser) GetRegistration

func (u MyUser) GetRegistration() *registration.Resource

type RegisterRequest

type RegisterRequest struct {
	Repository string `json:"repository"`
	CommitId   string `json:"commit_id"`
	Evidence   string `json:"evidence"`
	PublicKey  []byte `json:"public_key"`
}

type TA

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

func Default

func Default() (*TA, error)

func Init

func Init(config *TAConfig) (*TA, error)

func (*TA) Register

func (ta *TA) Register() (string, error)

func (*TA) TLSConfig

func (ap *TA) TLSConfig() (*tls.Config, error)

type TAConfig

type TAConfig struct {
	Token        string
	Repository   string
	CommitID     string
	TADomain     string
	MonitorBases []string
	ServiceBase  string
	Email        string
}

func DefaultConfig

func DefaultConfig() (*TAConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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