Package org.cryptomator.cryptolib.api
Interface MasterkeyLoader
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MasterkeyLoader
Masterkey loaders load keys to unlock Cryptomator vaults.- See Also:
MasterkeyFileAccess
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Masterkey
loadKey(URI keyId)
Loads a master key.
-
-
-
Method Detail
-
loadKey
Masterkey loadKey(URI keyId) throws MasterkeyLoadingFailedException
Loads a master key. This might be a long-running operation, as it may require user input or expensive computations.It is the caller's responsibility to destroy the returned
Masterkey
after usage by callingDestroyableSecretKey.destroy()
. This can easily be done using a try-with-resource block:Masterkeyloader keyLoader; URI keyId; try (Masterkey key = keyLoader.loadKey(keyId) ){ // Do stuff with the key }
- Parameters:
keyId
- An URI uniquely identifying the source and identity of the key- Returns:
- a
Masterkey
object wrapping the raw key bytes. Must not be null - Throws:
MasterkeyLoadingFailedException
- Thrown when it is impossible to fulfill the request
-
-