pub enum KipukaError {
}Expand description
Unified error type for the Kipuka EST server.
Each variant maps to a specific failure domain. The [IntoResponse]
implementation translates these into HTTP responses suitable for EST
clients per RFC 7030 §4.2.3.
Variants§
Config(String)
Configuration file parse or validation error.
Tls(String)
TLS setup failure (certificate loading, cipher negotiation, etc.).
Db(String)
Database connection or query failure.
Hsm(String)
HSM / PKCS#11 session error.
Auth(String)
Authentication or authorization failure.
RFC 7030 §3.2.3: EST server MUST respond with 401 when the client fails HTTP-based or certificate-based authentication.
Est(String)
EST protocol-level error (bad CSR, unsupported operation, etc.).
RFC 7030 §4.2.3: the server MAY return a CMC response body with a Full PKI Response indicating the failure reason.
Ca(String)
CA signing or certificate issuance error.
Audit(String)
Audit subsystem failure.
NIAP CA PP FAU_STG.4: when the audit trail is full and the overflow
policy is halt, EST operations MUST be rejected.
Io(String)
I/O error (file system, socket, etc.).
NotFound
Resource not found (unknown EST label, unknown CA, etc.).
MethodNotAllowed
HTTP method not allowed on this endpoint.
PayloadTooLarge
Request payload exceeds configured max_body_size.
UnsupportedMediaType
Content-Type is not application/pkcs10 or another expected EST type.
RFC 7030 §4.2: EST endpoints expect specific MIME types.
Forbidden(String)
Forbidden: the client is authenticated but not authorized.
RFC 7231 §6.5.3: the server understood the request but refuses to authorize it. Used for EKU policy violations, identity mismatches, and revoked-certificate enrollment attempts.
BadRequest(String)
Bad request: malformed CSR, missing fields, etc.
Service temporarily unavailable (HSM offline, DB unreachable, etc.).
Internal(String)
Catch-all internal server error.
Trait Implementations§
Source§impl Debug for KipukaError
impl Debug for KipukaError
Source§impl Display for KipukaError
impl Display for KipukaError
Source§impl Error for KipukaError
impl Error for KipukaError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for KipukaError
impl From<Error> for KipukaError
Source§impl From<Error> for KipukaError
impl From<Error> for KipukaError
Source§impl From<IssuanceError> for KipukaError
impl From<IssuanceError> for KipukaError
Source§fn from(e: IssuanceError) -> Self
fn from(e: IssuanceError) -> Self
Classify an issuance failure into the correct HTTP domain.
A fault in the client-supplied CSR (bad self-signature/PoP, undersized
key, disallowed algorithm, prohibited DN attribute) is a
BadRequest → 400: the requester can fix
the CSR and retry, and the specific reason is safe to return. Every
other failure — signing, storage, or a server-side profile
misconfiguration — is a Ca error → 500, whose
detail is logged but never exposed to the client.
The client/server split is owned by
IssuanceError::is_client_error
so HTTP and CoAP transports classify identically.
Source§impl IntoResponse for KipukaError
impl IntoResponse for KipukaError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl Freeze for KipukaError
impl RefUnwindSafe for KipukaError
impl Send for KipukaError
impl Sync for KipukaError
impl Unpin for KipukaError
impl UnsafeUnpin for KipukaError
impl UnwindSafe for KipukaError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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