pub struct X509CredentialAcquisition<T: Debug = Initialized> { /* private fields */ }Expand description
The type representing the X509 acquisition process.
Performs the two ACME challenges necessary to obtain a certificate, wire-dpop-01 and wire-oidc-01, in that order.
State transitions: (*) | | ::try_new() | v Initialized | | .complete_dpop_challenge() | v DpopChallengeCompleted | | .complete_oidc_challenge() | v (no final state, acquisition is consumed)
After the second (OIDC) challenge, the signing keypair and the certificate chain is returned to the caller. Regardless of success, the acquisition instance is consumed and cannot be used anymore.
Sample usage:
let acq = X509CredentialAcquisition::try_new(pki_env, config)?;
let (sign_kp, certs) = acq
.complete_dpop_challenge().await?
.complete_oidc_challenge().await?;Implementations§
Source§impl X509CredentialAcquisition<Initialized>
impl X509CredentialAcquisition<Initialized>
Sourcepub async fn complete_dpop_challenge(
self,
) -> Result<X509CredentialAcquisition<DpopChallengeCompleted>>
pub async fn complete_dpop_challenge( self, ) -> Result<X509CredentialAcquisition<DpopChallengeCompleted>>
Complete the DPoP challenge.
Source§impl X509CredentialAcquisition<Initialized>
impl X509CredentialAcquisition<Initialized>
Sourcepub fn try_new(
pki_env: Arc<PkiEnvironment>,
config: X509CredentialConfiguration,
) -> E2eIdentityResult<Self>
pub fn try_new( pki_env: Arc<PkiEnvironment>, config: X509CredentialConfiguration, ) -> E2eIdentityResult<Self>
Create the acquisition object.
Generates the signing and ACME keypairs, but does not perform any network I/O.
Source§impl X509CredentialAcquisition<DpopChallengeCompleted>
impl X509CredentialAcquisition<DpopChallengeCompleted>
Sourcepub async fn complete_oidc_challenge(self) -> Result<(Pem, Vec<Vec<u8>>)>
pub async fn complete_oidc_challenge(self) -> Result<(Pem, Vec<Vec<u8>>)>
Complete the OIDC challenge and get the certificate chain.
Returns (signing keypair in PEM format, certificate chain). The first certificate in the chain is the end-entity certificate, i.e. the one certifying the public portion of the signing keypair.
Trait Implementations§
Source§impl<T: Debug> Debug for X509CredentialAcquisition<T>
impl<T: Debug> Debug for X509CredentialAcquisition<T>
Auto Trait Implementations§
impl<T> Freeze for X509CredentialAcquisition<T>where
T: Freeze,
impl<T = Initialized> !RefUnwindSafe for X509CredentialAcquisition<T>
impl<T> Send for X509CredentialAcquisition<T>where
T: Send,
impl<T> Sync for X509CredentialAcquisition<T>where
T: Sync,
impl<T> Unpin for X509CredentialAcquisition<T>where
T: Unpin,
impl<T = Initialized> !UnwindSafe for X509CredentialAcquisition<T>
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
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