markKeyAsUsed

suspend fun markKeyAsUsed(keyInfo: KeyInfo, atTime: Instant = Clock.System.now())

Marks a key retrieved with getKey as used.

Note that this function may perform network I/O to replenish the key pool if the number of available fresh keys drops below the threshold.

Parameters

keyInfo

the KeyInfo returned from the getKey call.

atTime

the current time, to take into consideration for evicting expired keys.

Throws

if no such certified key exists.

CancellationException

if the coroutine is cancelled.


suspend fun markKeyAsUsed(certifiedKey: CertifiedKey, atTime: Instant = Clock.System.now())

Marks a key retrieved with getKey as used.

Parameters

certifiedKey

the CertifiedKey returned from the getKey call.

atTime

the current time, to take into consideration for evicting expired keys.

Throws

if no such certified key exists.

CancellationException

if the coroutine is cancelled.


suspend fun markKeyAsUsed(alias: String, atTime: Instant = Clock.System.now())

Marks a key retrieved with getKey as used by its alias.

Parameters

alias

the alias of the key to mark as used.

atTime

the current time, to take into consideration for evicting expired keys.

Throws

if no such certified key exists.

CancellationException

if the coroutine is cancelled.