Skip to main content

CaConfig

Struct CaConfig 

Source
pub struct CaConfig {
Show 14 fields pub id: String, pub is_default: bool, pub key_file: String, pub cert_file: String, pub key_type: String, pub pkcs11_uri: Option<String>, pub validity_days: u32, pub hash_algorithm: String, pub crl_url: Option<String>, pub ocsp_url: Option<String>, pub common_name: String, pub organization: String, pub crl_lifetime_secs: u64, pub cab_forum_compliant: bool,
}
Expand description

[[ca]] section — per-CA key material and issuance policy.

Multiple CAs are supported via the TOML array-of-tables syntax:

[[ca]]
id = "production"
is_default = true
key_file = "/etc/kipuka/ca-prod.key"
cert_file = "/etc/kipuka/ca-prod.crt"

[[ca]]
id = "dev"
key_file = "/etc/kipuka/ca-dev.key"
cert_file = "/etc/kipuka/ca-dev.crt"
validity_days = 30

Fields§

§id: String

Unique identifier for this CA.

Used in EST label configurations to route enrollment requests to the appropriate CA. Must match ^[a-z0-9][a-z0-9_-]*$ and be at most 64 characters.

§is_default: bool

Whether this CA is the default for EST labels that do not specify a ca_id. Exactly one CA must be marked as default when multiple CAs are configured.

§key_file: String

Path to the CA private key in PEM format.

Mutually exclusive with pkcs11_uri: when pkcs11_uri is set, the key is accessed via the HSM and this field is ignored.

§cert_file: String

Path to the CA certificate (or chain) in PEM format.

The file should contain the CA’s end-entity certificate first, followed by any intermediates up to (but not including) the root.

§key_type: String

Key type for CA key generation (used only when key_file does not exist and auto-generation is requested).

Supported values:

Classical:

  • "rsa:2048", "rsa:3072", "rsa:4096"
  • "ec:P-256", "ec:P-384", "ec:P-521"
  • "ed25519"

Post-Quantum (FIPS 204 — ML-DSA standalone):

  • "ml-dsa-44" (NIST Security Level 2, ~2.5 KB sig)
  • "ml-dsa-65" (NIST Security Level 3, ~3.3 KB sig)
  • "ml-dsa-87" (NIST Security Level 5, ~4.6 KB sig)

Composite (draft-ietf-lamps-pq-composite-sigs-19):

  • "ml-dsa-44-with-rsa-2048", "ml-dsa-44-with-rsa-3072"
  • "ml-dsa-44-with-ec-P-256"
  • "ml-dsa-65-with-ec-P-384"
  • "ml-dsa-65-with-rsa-3072", "ml-dsa-65-with-rsa-4096"
  • "ml-dsa-87-with-ec-P-384"
  • "ml-dsa-87-with-ed448"

Default: "ec:P-256".

§pkcs11_uri: Option<String>

PKCS#11 URI for HSM-backed CA key.

When set, the CA private key is accessed via the configured HSM ([hsm] section) instead of reading key_file from disk.

Example: "pkcs11:token=kipuka;object=ca-key;type=private"

§validity_days: u32

Default validity period for issued end-entity certificates (days).

CA/B Forum BR §6.3.2 limits publicly-trusted certificates to 398 days (roughly 13 months). Private CAs may use longer periods.

Default: 365 days.

§hash_algorithm: String

Hash algorithm for certificate and CRL signing.

Supported: "sha256", "sha384", "sha512". Default: "sha256".

§crl_url: Option<String>

CRL distribution point URL embedded in issued certificates.

§ocsp_url: Option<String>

OCSP responder URL embedded in issued certificates.

§common_name: String

Subject Common Name for auto-generated CA certificates.

§organization: String

Subject Organization for auto-generated CA certificates.

§crl_lifetime_secs: u64

CRL validity period in seconds.

Determines the nextUpdate field in generated CRLs. Default: 86400 (24 hours).

§cab_forum_compliant: bool

CA/B Forum compliance mode.

When true, the server enforces:

  • Maximum 398-day end-entity certificate validity
  • Required key usage and extended key usage extensions
  • Minimum RSA 2048-bit key size in CSRs

Implementations§

Source§

impl CaConfig

Source

pub fn is_hsm_backed(&self) -> bool

Returns true when this CA uses an HSM-backed key via PKCS#11.

Trait Implementations§

Source§

impl Clone for CaConfig

Source§

fn clone(&self) -> CaConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CaConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CaConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,