Skip to content

Commit 90261c6

Browse files
committed
Rename change_key() to update_key()
1 parent e000fe6 commit 90261c6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/account.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ impl Account {
332332
&self.inner.id
333333
}
334334

335-
/// Account key rollover
335+
/// Update the account's authentication key
336336
///
337337
/// This is useful if you want to change the ACME account key of an existing account, e.g.
338338
/// to mitigate the risk of a key compromise. This method creates a new client key and changes
339339
/// the key associated with the existing account. `self` will be updated with the new key,
340340
/// and a fresh set of [`AccountCredentials`] will be returned to update stored credentials.
341341
///
342342
/// See <https://datatracker.ietf.org/doc/html/rfc8555#section-7.3.5> for more information.
343-
pub async fn change_key(&mut self) -> Result<AccountCredentials, Error> {
343+
pub async fn update_key(&mut self) -> Result<AccountCredentials, Error> {
344344
let new_key_url = match self.inner.client.directory.key_change.as_deref() {
345345
Some(url) => url,
346346
None => return Err("Account key rollover not supported by ACME CA".into()),

tests/pebble.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,15 @@ async fn update_contacts() -> Result<(), Box<dyn StdError>> {
334334

335335
#[tokio::test]
336336
#[ignore]
337-
async fn change_key() -> Result<(), Box<dyn StdError>> {
337+
async fn update_key() -> Result<(), Box<dyn StdError>> {
338338
try_tracing_init();
339339

340340
// Creat an env/initial account
341341
let mut env = Environment::new(EnvironmentConfig::default()).await?;
342342
let old_account = env.account.clone();
343343

344344
// Change the account key
345-
let new_credentials = env.account.change_key().await?;
345+
let new_credentials = env.account.update_key().await?;
346346

347347
// Using the old ACME account key should now produce malformed error.
348348
let Err(Error::Api(problem)) = old_account

0 commit comments

Comments
 (0)