File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -456,6 +456,28 @@ impl ChallengeHandle<'_> {
456456 }
457457 }
458458
459+ /// Notify the server that the challenge is ready and provide a payload
460+ ///
461+ /// This function is for the ACME challenge device-attest-01.
462+ /// See <https://datatracker.ietf.org/doc/draft-acme-device-attest/> for details.
463+ ///
464+ /// Note: Do not use this function for http-01, tls-alpn-01 or dns-01 challenges.
465+ ///
466+ /// `payload` should serialize to "attObj" as defined in link.
467+ pub async fn set_ready_with_payload ( & mut self , payload : & impl Serialize ) -> Result < ( ) , Error > {
468+ let rsp = self
469+ . account
470+ . post ( Some ( payload) , self . nonce . take ( ) , & self . challenge . url )
471+ . await ?;
472+
473+ * self . nonce = nonce_from_response ( & rsp) ;
474+ let response = Problem :: check :: < Challenge > ( rsp) . await ?;
475+ match response. error {
476+ Some ( details) => Err ( Error :: Api ( details) ) ,
477+ None => Ok ( ( ) ) ,
478+ }
479+ }
480+
459481 /// Create a [`KeyAuthorization`] for this challenge
460482 ///
461483 /// Combines a challenge's token with the thumbprint of the account's public key to compute
You can’t perform that action at this time.
0 commit comments