pub struct EnrollRequest { /* private fields */ }Expand description
Enrollment request containing a PKCS#10 CSR (RFC 7030 §4.2.1).
The CSR must include:
- Subject public key (ML-DSA, ML-KEM, or traditional)
- Subject distinguished name
- Signature proving possession of the private key (POP)
For ML-DSA CSRs, the signature algorithm OID indicates the ML-DSA level. For ML-KEM CSRs, a separate ML-DSA signature is required for POP.
The wire format is a DER-encoded CertificationRequest per RFC 2986.
Use CertificationRequest for parsed/structured access to CSR fields.
Implementations§
Source§impl EnrollRequest
impl EnrollRequest
Sourcepub fn new(csr_der: Vec<u8>) -> Self
pub fn new(csr_der: Vec<u8>) -> Self
Creates a new enrollment request from a DER-encoded PKCS#10 CSR.
Sourcepub fn into_csr_der(self) -> Vec<u8> ⓘ
pub fn into_csr_der(self) -> Vec<u8> ⓘ
Consumes self and returns the DER-encoded CSR.
Sourcepub fn from_base64(base64_data: &str) -> EstResult<Self>
pub fn from_base64(base64_data: &str) -> EstResult<Self>
Decodes a base64-encoded enrollment request.
Sourcepub fn validate(&self) -> EstResult<()>
pub fn validate(&self) -> EstResult<()>
Validates the CSR structure and proof-of-possession.
This performs basic DER validation. Full cryptographic validation (signature verification) is delegated to the CA module.
Sourcepub fn detect_signature_algorithm(&self) -> Option<String>
pub fn detect_signature_algorithm(&self) -> Option<String>
Detects the signature algorithm OID from the CSR.
Returns the OID string if found, or None if parsing fails.
This is used to route CSRs to the appropriate CA signing key
(ML-DSA-44/65/87, composite, or traditional).
Note: This is a simple heuristic parser. Full ASN.1 parsing is performed by the CA module.
Sourcepub fn contains_ml_dsa(&self) -> bool
pub fn contains_ml_dsa(&self) -> bool
Checks if the CSR appears to contain an ML-DSA public key.
Searches for ML-DSA OID prefixes in the DER structure.
Sourcepub fn contains_ml_kem(&self) -> bool
pub fn contains_ml_kem(&self) -> bool
Checks if the CSR appears to contain an ML-KEM public key.
Searches for ML-KEM OID prefixes in the DER structure.
Sourcepub fn to_certification_request(&self) -> CertificationRequest
pub fn to_certification_request(&self) -> CertificationRequest
Returns a parsed CertificationRequest from the DER-encoded CSR.
This is a placeholder that creates a CertificationRequest with
default/empty fields. Full ASN.1 parsing of the RFC 2986 structure
is performed by the CA module using synta.
Callers should use this to get the struct, then have the CA module populate the fields from actual DER parsing.
Trait Implementations§
Source§impl Clone for EnrollRequest
impl Clone for EnrollRequest
Source§fn clone(&self) -> EnrollRequest
fn clone(&self) -> EnrollRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more