ejbca

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

func NewAuthorizedEndEntityProfilesDataSource

func NewAuthorizedEndEntityProfilesDataSource() datasource.DataSource

func NewCaPemDataSource

func NewCaPemDataSource() datasource.DataSource

func NewCertificateResource

func NewCertificateResource() resource.Resource

func NewEndEntityProfileDataSource

func NewEndEntityProfileDataSource() datasource.DataSource

func NewEndEntityResource

func NewEndEntityResource() resource.Resource

Types

type AuthorizedEndEntityProfilesDataSource

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

AuthorizedEndEntityProfilesDataSource defines the data source implementation.

func (*AuthorizedEndEntityProfilesDataSource) Configure

func (*AuthorizedEndEntityProfilesDataSource) Metadata

func (*AuthorizedEndEntityProfilesDataSource) Read

func (*AuthorizedEndEntityProfilesDataSource) Schema

type AuthorizedEndEntityProfilesDataSourceModel

type AuthorizedEndEntityProfilesDataSourceModel struct {
	AuthorizedEndEntityProfiles types.Set   `tfsdk:"authorized_end_entity_profiles"`
	ID                          types.Int64 `tfsdk:"id"`
}

AuthorizedEndEntityProfilesDataSourceModel describes the data source data model.

type CaPemDataSource

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

CaPemDataSource defines the data source implementation.

func (*CaPemDataSource) Configure

func (*CaPemDataSource) Metadata

func (*CaPemDataSource) Read

func (*CaPemDataSource) Schema

type CaPemDataSourceModel

type CaPemDataSourceModel struct {
	Dn    types.String `tfsdk:"dn"`
	CaPem types.String `tfsdk:"ca_pem"`
	ID    types.String `tfsdk:"id"`
}

type CertAuthProviderModel added in v1.1.0

type CertAuthProviderModel struct {
	ClientCertPath types.String `tfsdk:"client_cert_path"`
	ClientKeyPath  types.String `tfsdk:"client_key_path"`
}

type CertificateContext

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

func CreateCertificateContext

func CreateCertificateContext(ctx context.Context, client *ejbca.APIClient) *CertificateContext

func (*CertificateContext) ComposeStateFromCertificateResponse

func (c *CertificateContext) ComposeStateFromCertificateResponse(certificate *ejbca.CertificateRestResponse, state *CertificateResourceModel) diag.Diagnostics

ComposeStateFromCertificateResponse extracts the certificate from an EJBCA CertificateRestResponse, encodes it to PEM format if necessary, and either extracts or downloads the certificate chain.

func (*CertificateContext) DownloadCAChain added in v1.1.0

func (c *CertificateContext) DownloadCAChain(issuerDN string) ([]*x509.Certificate, diag.Diagnostics)

func (*CertificateContext) EnrollPkcs10Certificate

func (c *CertificateContext) EnrollPkcs10Certificate(state *CertificateResourceModel) diag.Diagnostics

func (*CertificateContext) IsCertificateRevoked added in v1.1.0

func (c *CertificateContext) IsCertificateRevoked(issuerDN string, serialNumber string) (bool, diag.Diagnostics)

func (*CertificateContext) ReadCertificate added in v1.1.0

func (c *CertificateContext) ReadCertificate(state *CertificateResourceModel) diag.Diagnostics

func (*CertificateContext) RevokeCertificate

func (c *CertificateContext) RevokeCertificate(issuerDn string, certificateSerialNumber string) diag.Diagnostics

type CertificateResource

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

CertificateResource defines the resource implementation.

func (*CertificateResource) Configure

func (*CertificateResource) Create

func (*CertificateResource) Delete

func (*CertificateResource) ImportState

func (*CertificateResource) Metadata

func (*CertificateResource) ModifyPlan added in v1.1.0

ModifyPlan determines if the certificate resource needs to be replaced. The two cases where this is true are:

  • The certificate is expired (-early_renewal_hours)
  • The certificate is revoked

func (*CertificateResource) Read

func (*CertificateResource) Schema

func (*CertificateResource) Update

type CertificateResourceModel

type CertificateResourceModel struct {
	ID                        types.String `tfsdk:"id"`
	CertificateSigningRequest types.String `tfsdk:"certificate_signing_request"`
	CertificateProfileName    types.String `tfsdk:"certificate_profile_name"`
	EndEntityProfileName      types.String `tfsdk:"end_entity_profile_name"`
	CertificateAuthorityName  types.String `tfsdk:"certificate_authority_name"`
	EndEntityName             types.String `tfsdk:"end_entity_name"`
	Certificate               types.String `tfsdk:"certificate"`
	Chain                     types.String `tfsdk:"chain"`
	IssuerDn                  types.String `tfsdk:"issuer_dn"`
	AccountBindingID          types.String `tfsdk:"account_binding_id"`
	ValidityEndTime           types.String `tfsdk:"validity_end_time"`
	ValidityStartTime         types.String `tfsdk:"validity_start_time"`
	EarlyRenewalHours         types.Int64  `tfsdk:"early_renewal_hours"`
	ReadyForRenewal           types.Bool   `tfsdk:"ready_for_renewal"`
	IsRevoked                 types.Bool   `tfsdk:"is_revoked"`
}

CertificateResourceModel describes the resource data model.

type EndEntityContext

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

func CreateEndEntityContext

func CreateEndEntityContext(ctx context.Context, client *ejbca.APIClient) *EndEntityContext

func (*EndEntityContext) CreateEndEntity

func (c *EndEntityContext) CreateEndEntity(state *EndEntityResourceModel) diag.Diagnostics

func (*EndEntityContext) DeleteEndEntity

func (c *EndEntityContext) DeleteEndEntity(state *EndEntityResourceModel) diag.Diagnostics

func (*EndEntityContext) ReadEndEntityContext

func (c *EndEntityContext) ReadEndEntityContext(state *EndEntityResourceModel) diag.Diagnostics

func (*EndEntityContext) UpdateEndEntityStatus

func (c *EndEntityContext) UpdateEndEntityStatus(state *EndEntityResourceModel) diag.Diagnostics

type EndEntityProfileDataSource

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

EndEntityProfileDataSource defines the data source implementation.

func (*EndEntityProfileDataSource) Configure

func (*EndEntityProfileDataSource) Metadata

func (*EndEntityProfileDataSource) Read

func (*EndEntityProfileDataSource) Schema

type EndEntityProfileDataSourceModel

type EndEntityProfileDataSourceModel struct {
	EndEntityProfileName           types.String `tfsdk:"end_entity_profile_name"`
	SubjectDistinguishedNameFields types.Set    `tfsdk:"subject_distinguished_name_fields"`
	SubjectAlternativeNameFields   types.List   `tfsdk:"subject_alternative_name_fields"`
	AvailableCertificateProfiles   types.Set    `tfsdk:"available_certificate_profiles"`
	AvailableCAs                   types.Set    `tfsdk:"available_cas"`
	ID                             types.String `tfsdk:"id"`
}

EndEntityProfileDataSourceModel describes the data source data model.

type EndEntityResource

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

EndEntityResource defines the resource implementation.

func (*EndEntityResource) Configure

func (*EndEntityResource) Create

func (*EndEntityResource) Delete

func (*EndEntityResource) ImportState

func (*EndEntityResource) Metadata

func (*EndEntityResource) Read

func (*EndEntityResource) Schema

func (*EndEntityResource) Update

type EndEntityResourceModel

type EndEntityResourceModel struct {
	ID                     types.String `tfsdk:"id"`
	EndEntityName          types.String `tfsdk:"end_entity_name"`
	EndEntityPassword      types.String `tfsdk:"end_entity_password"` // Not returned
	SubjectDn              types.String `tfsdk:"subject_dn"`
	SubjectAltName         types.String `tfsdk:"subject_alt_name"`
	Email                  types.String `tfsdk:"email"`
	CaName                 types.String `tfsdk:"ca_name"`                  // Not returned
	CertificateProfileName types.String `tfsdk:"certificate_profile_name"` // Not returned
	EndEntityProfileName   types.String `tfsdk:"end_entity_profile_name"`  // Not returned
	Token                  types.String `tfsdk:"token"`
	AccountBindingID       types.String `tfsdk:"account_binding_id"` // Not returned
	Status                 types.String `tfsdk:"status"`
}

type OAuthProviderModel added in v1.1.0

type OAuthProviderModel struct {
	TokenURL     types.String `tfsdk:"token_url"`
	ClientID     types.String `tfsdk:"client_id"`
	ClientSecret types.String `tfsdk:"client_secret"`
	Scopes       types.String `tfsdk:"scopes"`
	Audience     types.String `tfsdk:"audience"`
}

type Provider

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

Provider defines the ejbca implementation.

func (*Provider) Configure

func (*Provider) DataSources

func (p *Provider) DataSources(context.Context) []func() datasource.DataSource

func (*Provider) Metadata

func (*Provider) Resources

func (p *Provider) Resources(context.Context) []func() resource.Resource

func (*Provider) Schema

type ProviderModel

type ProviderModel struct {
	Hostname   types.String `tfsdk:"hostname"`
	CaCertPath types.String `tfsdk:"ca_cert_path"`
	CertAuth   types.Object `tfsdk:"cert_auth"`
	OAuth      types.Object `tfsdk:"oauth"`
}

ProviderModel describes the ejbca provider data model.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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