Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/acc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ impl<P: Persist> Account<P> {
Ok(NewOrder { order })
}


/// Load an existing order from its URL.
///
/// This can be used to resume processing of an order that was
/// created earlier.
pub fn load_order(&self, order_url: &str) -> Result<NewOrder<P>> {
let res = self.inner.transport.call(order_url, "")?;
let api_order: ApiOrder = read_json(res)?;
let order = Order::new(&self.inner, api_order, order_url.to_string());
Ok(NewOrder { order })
}

/// Revoke a certificate for the reason given.
///
/// This calls the ACME API revoke endpoint, but does not affect the locally persisted
Expand Down
6 changes: 6 additions & 0 deletions src/order/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ impl<P: Persist> NewOrder<P> {
pub fn api_order(&self) -> &ApiOrder {
&self.order.api_order
}


/// Access the order url
pub fn order_url(&self) -> String {
self.order.url.clone()
}
}

/// An order that is ready for a [CSR] submission.
Expand Down