Create constructor for KeyAuthorization
This commit is contained in:
parent
f34971b3e8
commit
b87f572719
|
@ -71,7 +71,7 @@ impl Order {
|
||||||
/// Signs the challenge's token with the account's private key and use the
|
/// Signs the challenge's token with the account's private key and use the
|
||||||
/// value from [`KeyAuthorization::as_str()`] as the challenge response.
|
/// value from [`KeyAuthorization::as_str()`] as the challenge response.
|
||||||
pub fn key_authorization(&self, challenge: &Challenge) -> KeyAuthorization {
|
pub fn key_authorization(&self, challenge: &Challenge) -> KeyAuthorization {
|
||||||
KeyAuthorization(format!("{}.{}", challenge.token, &self.account.key.thumb))
|
KeyAuthorization::new(challenge, &self.account.key)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request a certificate from the given Certificate Signing Request (CSR)
|
/// Request a certificate from the given Certificate Signing Request (CSR)
|
||||||
|
@ -429,9 +429,13 @@ trait Signer {
|
||||||
/// <https://datatracker.ietf.org/doc/html/rfc8555#section-8.1>
|
/// <https://datatracker.ietf.org/doc/html/rfc8555#section-8.1>
|
||||||
///
|
///
|
||||||
/// <https://datatracker.ietf.org/doc/html/rfc8737#section-3>
|
/// <https://datatracker.ietf.org/doc/html/rfc8737#section-3>
|
||||||
pub struct KeyAuthorization(pub(crate) String);
|
pub struct KeyAuthorization(String);
|
||||||
|
|
||||||
impl KeyAuthorization {
|
impl KeyAuthorization {
|
||||||
|
fn new(challenge: &Challenge, key: &Key) -> Self {
|
||||||
|
Self(format!("{}.{}", challenge.token, &key.thumb))
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the key authorization value
|
/// Get the key authorization value
|
||||||
pub fn as_str(&self) -> &str {
|
pub fn as_str(&self) -> &str {
|
||||||
&self.0
|
&self.0
|
||||||
|
|
Loading…
Reference in New Issue