ejbca

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 23 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

func NewKeystoreResource

func NewKeystoreResource() 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 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) ComposeStateFromKeystoreResponse

func (c *CertificateContext) ComposeStateFromKeystoreResponse(certificate *ejbca.CertificateRestResponse, state *KeystoreResourceModel) diag.Diagnostics

func (*CertificateContext) DownloadCaChain

func (c *CertificateContext) DownloadCaChain(issuerDn string) ([]*x509.Certificate, error)

func (*CertificateContext) EnrollKeystore

func (c *CertificateContext) EnrollKeystore(state *KeystoreResourceModel) diag.Diagnostics

func (*CertificateContext) EnrollPkcs10Certificate

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

func (*CertificateContext) ReadCertificateContext

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

func (*CertificateContext) ReadKeystoreContext

func (c *CertificateContext) ReadKeystoreContext(state *KeystoreResourceModel) 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) 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"`
	EndEntityPassword         types.String `tfsdk:"end_entity_password"`
	Certificate               types.String `tfsdk:"certificate"`
	IssuerDn                  types.String `tfsdk:"issuer_dn"`
}

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 KeystoreResource

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

KeystoreResource defines the resource implementation.

func (*KeystoreResource) Configure

func (*KeystoreResource) Create

func (*KeystoreResource) Delete

func (*KeystoreResource) ImportState

func (*KeystoreResource) Metadata

func (*KeystoreResource) Read

func (*KeystoreResource) Schema

func (*KeystoreResource) Update

type KeystoreResourceModel

type KeystoreResourceModel struct {
	Id                types.String `tfsdk:"id"`
	EndEntityName     types.String `tfsdk:"end_entity_name"`
	EndEntityPassword types.String `tfsdk:"end_entity_password"`
	KeyAlg            types.String `tfsdk:"key_alg"`
	KeySpec           types.String `tfsdk:"key_spec"`
	Certificate       types.String `tfsdk:"certificate"`
	Key               types.String `tfsdk:"key"`
	IssuerDn          types.String `tfsdk:"issuer_dn"`
}

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(ctx context.Context) []func() datasource.DataSource

func (*Provider) Metadata

func (*Provider) Resources

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

func (*Provider) Schema

type ProviderModel

type ProviderModel struct {
	Hostname          types.String `tfsdk:"hostname"`
	ClientCertPath    types.String `tfsdk:"client_cert_path"`
	ClientCertKeyPath types.String `tfsdk:"client_cert_key_path"`
}

ProviderModel describes the ejbca data model.

Jump to

Keyboard shortcuts

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