RustyE2eIdentity

Struct RustyE2eIdentity 

Source
pub struct RustyE2eIdentity {
    pub sign_alg: JwsAlgorithm,
    pub sign_kp: Pem,
    pub hash_alg: HashAlgorithm,
    pub acme_kp: Pem,
    pub acme_jwk: Jwk,
}

Fields§

§sign_alg: JwsAlgorithm§sign_kp: Pem§hash_alg: HashAlgorithm§acme_kp: Pem§acme_jwk: Jwk

Implementations§

Source§

impl RustyE2eIdentity

Enrollment flow.

Source

pub fn try_new( sign_alg: JwsAlgorithm, raw_sign_key: Vec<u8>, ) -> E2eIdentityResult<Self>

Builds an instance holding private key material. This instance has to be used in the whole enrollment process then dropped to clear secret key material.

§Parameters
  • sign_alg - Signature algorithm (only Ed25519 for now)
  • raw_sign_key - Raw signature key as bytes
Source

pub fn acme_directory_response( &self, directory: Json, ) -> E2eIdentityResult<AcmeDirectory>

Parses the response from GET /acme/{provisioner-name}/directory. Use this AcmeDirectory in the next step to fetch the first nonce from the acme server. Use AcmeDirectory::new_nonce.

See RFC 8555 Section 7.1.1

§Parameters
  • directory - http response body
Source

pub fn acme_new_account_request( &self, directory: &AcmeDirectory, previous_nonce: String, ) -> E2eIdentityResult<Json>

For creating a new acme account. This returns a signed JWS-alike request body to send to POST /acme/{provisioner-name}/new-account.

See RFC 8555 Section 7.3.

§Parameters
Source

pub fn acme_new_account_response( &self, account: Json, ) -> E2eIdentityResult<E2eiAcmeAccount>

Parses the response from POST /acme/{provisioner-name}/new-account.

See RFC 8555 Section 7.3.

§Parameters
  • account - http response body
Source

pub fn acme_new_order_request( &self, display_name: &str, client_id: &str, handle: &str, expiry: Duration, directory: &AcmeDirectory, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Creates a new acme order for the handle (userId + display name) and the clientId.

See RFC 8555 Section 7.4.

§Parameters
  • display_name - human readable name displayed in the application e.g. Smith, Alice M (QA)
  • domain - DNS name of owning backend e.g. example.com
  • client_id - client identifier with user b64Url encoded & clientId hex encoded e.g. NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ/6add501bacd1d90e@example.com
  • handle - user handle e.g. alice.smith.qa@example.com
  • expiry - x509 generated certificate expiry
  • directory - you got from Self::acme_directory_response
  • account - you got from Self::acme_new_account_response
  • previous_nonce - “replay-nonce” response header from POST /acme/{provisioner-name}/new-account
Source

pub fn acme_new_order_response( &self, new_order: Json, ) -> E2eIdentityResult<E2eiNewAcmeOrder>

Parses the response from POST /acme/{provisioner-name}/new-order.

See RFC 8555 Section 7.4.

§Parameters
  • new_order - http response body
Source

pub fn acme_new_authz_request( &self, url: &Url, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Creates a new authorization request.

See RFC 8555 Section 7.5.

§Parameters
  • url - one of the URL in new order’s authorizations (from Self::acme_new_order_response)
  • account - you got from Self::acme_new_account_response
  • previous_nonce - “replay-nonce” response header from POST /acme/{provisioner-name}/new-order (or from the previous to this method if you are creating the second authorization)
Source

pub fn acme_new_authz_response( &self, new_authz: Json, ) -> E2eIdentityResult<E2eiAcmeAuthorization>

Parses the response from POST /acme/{provisioner-name}/authz/{authz-id}

You then have to map the challenge from this authorization object. The client_id_challenge will be the one with the client_id_host (you supplied to Self::acme_new_order_request) identifier, the other will be your handle_challenge.

See RFC 8555 Section 7.5.

§Parameters
  • new_authz - http response body
Source

pub fn new_dpop_token( &self, client_id: &str, display_name: &str, dpop_challenge: &E2eiAcmeChallenge, backend_nonce: String, handle: &str, team: Option<String>, expiry: Duration, ) -> E2eIdentityResult<String>

Generates a new client Dpop JWT token. It demonstrates proof of possession of the nonces (from wire-server & acme server) and will be verified by the acme server when verifying the challenge (in order to deliver a certificate).

Then send it to POST /clients/{id}/access-token on wire-server.

§Parameters
  • access_token_url - backend endpoint where this token will be sent. Should be this one
  • client_id - client identifier with user b64Url encoded & clientId hex encoded e.g. NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com
  • dpop_challenge - you found after Self::acme_new_authz_response
  • backend_nonce - you get by calling GET /clients/token/nonce on wire-server.
  • handle - user handle e.g. alice.smith.qa@example.com See endpoint definition
  • expiry - token expiry
Source

pub fn acme_dpop_challenge_request( &self, access_token: String, dpop_challenge: &E2eiAcmeChallenge, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Creates a new challenge request.

See RFC 8555 Section 7.5.1.

§Parameters
Source

pub fn acme_oidc_challenge_request( &self, id_token: String, oidc_challenge: &E2eiAcmeChallenge, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Creates a new challenge request.

See RFC 8555 Section 7.5.1.

§Parameters
Source

pub fn acme_new_challenge_response( &self, challenge: Json, ) -> E2eIdentityResult<()>

Parses the response from POST /acme/{provisioner-name}/challenge/{challenge-id}.

See RFC 8555 Section 7.5.1.

§Parameters
  • challenge - http response body
Source

pub fn acme_check_order_request( &self, order_url: Url, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Verifies that the previous challenge has been completed.

See RFC 8555 Section 7.4.

§Parameters
Source

pub fn acme_check_order_response( &self, order: Json, ) -> E2eIdentityResult<E2eiAcmeOrder>

Parses the response from POST /acme/{provisioner-name}/order/{order-id}.

See RFC 8555 Section 7.4.

§Parameters
  • order - http response body
Source

pub fn acme_finalize_request( &self, order: &E2eiAcmeOrder, account: &E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Final step before fetching the certificate.

See RFC 8555 Section 7.4.

§Parameters
Source

pub fn acme_finalize_response( &self, finalize: Json, ) -> E2eIdentityResult<E2eiAcmeFinalize>

Parses the response from POST /acme/{provisioner-name}/order/{order-id}/finalize.

See RFC 8555 Section 7.4.

§Parameters
  • finalize - http response body
Source

pub fn acme_x509_certificate_request( &self, finalize: E2eiAcmeFinalize, account: E2eiAcmeAccount, previous_nonce: String, ) -> E2eIdentityResult<Json>

Creates a request for finally fetching the x509 certificate.

See RFC 8555 Section 7.4.2.

§Parameters
Source

pub fn acme_x509_certificate_response( &self, response: String, order: E2eiAcmeOrder, env: Option<&PkiEnvironment>, ) -> E2eIdentityResult<Vec<Vec<u8>>>

Parses the response from POST /acme/{provisioner-name}/certificate/{certificate-id}.

See RFC 8555 Section 7.4.2

§Parameters
  • response - http string response body

Trait Implementations§

Source§

impl Debug for RustyE2eIdentity

Source§

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

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

impl<'de> Deserialize<'de> for RustyE2eIdentity

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RustyE2eIdentity

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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

Source§

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

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T