certificateauthority

package
v2.32.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyRequest

type ApplyRequest struct {
	ID types.ID `request:"-"`

	Name        string `validate:"required"`
	Description string `validate:"min=0,max=512"`
	Tags        types.Tags
	IconID      types.ID

	Country          string
	Organization     string
	OrganizationUnit []string
	CommonName       string
	NotAfter         time.Time

	Clients []*ClientCert // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある
	Servers []*ServerCert // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある

	PollingTimeout  time.Duration // 証明書発行待ちのタイムアウト
	PollingInterval time.Duration // 証明書発行待ちのポーリング間隔
}

func (*ApplyRequest) Builder

func (req *ApplyRequest) Builder(caller sacloud.APICaller) (*Builder, error)

func (*ApplyRequest) Validate

func (req *ApplyRequest) Validate() error

type Builder

type Builder struct {
	ID types.ID // 新規登録時は空にする

	Name        string
	Description string
	Tags        types.Tags
	IconID      types.ID

	Country          string
	Organization     string
	OrganizationUnit []string
	CommonName       string
	NotAfter         time.Time

	Clients []*ClientCert // Note: ここに指定しなかったものはRevokeされる
	Servers []*ServerCert // Note: ここに指定しなかったものはRevokeされる

	Client sacloud.CertificateAuthorityAPI

	PollingTimeout  time.Duration // 証明書発行待ちのタイムアウト
	PollingInterval time.Duration // 証明書発行待ちのポーリング間隔
}

Builder マネージドPKI(CA)のビルダー

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (*CertificateAuthority, error)

type CertificateAuthority

CertificateAuthority sacloud/CertificateAuthorityのラッパー

CA/クライアント/サーバの詳細情報を保持する

type ClientCert

type ClientCert struct {
	ID string // 新規登録時は空にする

	Country                   string
	Organization              string
	OrganizationUnit          []string
	CommonName                string
	NotAfter                  time.Time
	IssuanceMethod            types.ECertificateAuthorityIssuanceMethod
	EMail                     string
	CertificateSigningRequest string
	PublicKey                 string

	Hold bool // 一時停止する時はTrue
}

ClientCert クライアント証明書のリクエストパラメータ

type CreateRequest

type CreateRequest struct {
	Name        string `validate:"required"`
	Description string `validate:"min=0,max=512"`
	Tags        types.Tags
	IconID      types.ID

	Country          string
	Organization     string
	OrganizationUnit []string
	CommonName       string
	NotAfter         time.Time

	Clients []*ClientCert // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある
	Servers []*ServerCert // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある

	PollingTimeout  time.Duration // 証明書発行待ちのタイムアウト
	PollingInterval time.Duration // 証明書発行待ちのポーリング間隔
}

func (*CreateRequest) ApplyRequest

func (req *CreateRequest) ApplyRequest() *ApplyRequest

func (*CreateRequest) Validate

func (req *CreateRequest) Validate() error

type DeleteRequest

type DeleteRequest struct {
	ID types.ID `request:"-" validate:"required"`

	FailIfNotFound bool `request:"-"`
}

func (*DeleteRequest) Validate

func (req *DeleteRequest) Validate() error

type FindRequest

type FindRequest struct {
	Names []string `request:"-"`
	Tags  []string `request:"-"`

	Sort  search.SortKeys
	Count int
	From  int
}

func (*FindRequest) ToRequestParameter

func (req *FindRequest) ToRequestParameter() (*sacloud.FindCondition, error)

func (*FindRequest) Validate

func (req *FindRequest) Validate() error

type ReadRequest

type ReadRequest struct {
	ID types.ID `request:"-" validate:"required"`
}

func (*ReadRequest) Validate

func (req *ReadRequest) Validate() error

type ServerCert

type ServerCert struct {
	ID string // 新規作成時は空にする

	Country                   string
	Organization              string
	OrganizationUnit          []string
	CommonName                string
	NotAfter                  time.Time
	SANs                      []string
	CertificateSigningRequest string
	PublicKey                 string

	Hold bool // 一時停止する時はTrue
}

ServerCert サーバ証明書のリクエストパラメータ

type Service

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

Service provides a high-level API of for CertificateAuthority

func New

func New(caller sacloud.APICaller) *Service

New returns new service instance of CertificateAuthority

func (*Service) Apply

func (s *Service) Apply(req *ApplyRequest) (*CertificateAuthority, error)

func (*Service) ApplyWithContext

func (s *Service) ApplyWithContext(ctx context.Context, req *ApplyRequest) (*CertificateAuthority, error)

func (*Service) Create

func (s *Service) Create(req *CreateRequest) (*CertificateAuthority, error)

func (*Service) CreateWithContext

func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*CertificateAuthority, error)

func (*Service) Delete

func (s *Service) Delete(req *DeleteRequest) error

func (*Service) DeleteWithContext

func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error

func (*Service) Find

func (*Service) FindWithContext

func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*sacloud.CertificateAuthority, error)

func (*Service) Read

func (s *Service) Read(req *ReadRequest) (*CertificateAuthority, error)

func (*Service) ReadWithContext

func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*CertificateAuthority, error)

func (*Service) Update

func (s *Service) Update(req *UpdateRequest) (*CertificateAuthority, error)

func (*Service) UpdateWithContext

func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*CertificateAuthority, error)

type UpdateRequest

type UpdateRequest struct {
	ID types.ID `request:"-" validate:"required"`

	Name        *string     `request:",omitempty" validate:"omitempty,min=1"`
	Description *string     `request:",omitempty" validate:"omitempty,min=1,max=512"`
	Tags        *types.Tags `request:",omitempty"`
	IconID      *types.ID   `request:",omitempty"`

	Clients []*ClientCert `request:",omitempty"` // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある
	Servers []*ServerCert `request:",omitempty"` // Note: API的に証明書の削除はできないため、指定した以上の証明書が存在する可能性がある

	PollingTimeout  time.Duration // 証明書発行待ちのタイムアウト
	PollingInterval time.Duration // 証明書発行待ちのポーリング間隔
}

func (*UpdateRequest) ApplyRequest

func (req *UpdateRequest) ApplyRequest(ctx context.Context, caller sacloud.APICaller) (*ApplyRequest, error)

func (*UpdateRequest) Validate

func (req *UpdateRequest) Validate() error

Jump to

Keyboard shortcuts

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