Class VaultConfig.UnverifiedVaultConfig

java.lang.Object
org.cryptomator.cryptofs.VaultConfig.UnverifiedVaultConfig
Enclosing class:
VaultConfig

public static class VaultConfig.UnverifiedVaultConfig extends Object
  • Method Details

    • getKeyId

      public URI getKeyId()
      Returns:
      The ID of the key required to load this config
    • getHeader

      public <T> T getHeader(String key, Class<T> clazz)
      Gets a value from the tokens header
      Type Parameters:
      T - Type of the value
      Parameters:
      key - Which key to read
      clazz - Type of the value
      Returns:
      The value or null if the key doesn't exist
    • allegedVaultVersion

      public int allegedVaultVersion()
      Returns:
      The unverified vault version (signature not verified)
    • allegedShorteningThreshold

      public int allegedShorteningThreshold()
      Returns:
      The unverified shortening threshold (signature not verified)
    • verify

      public VaultConfig verify(byte[] rawKey, int expectedVaultVersion) throws VaultKeyInvalidException, VaultVersionMismatchException, VaultConfigLoadException
      Decodes a vault configuration stored in JWT format.
      Parameters:
      rawKey - The key matching the id in getKeyId()
      expectedVaultVersion - The vault version this token should contain
      Returns:
      The decoded configuration
      Throws:
      VaultKeyInvalidException - If the provided key was invalid
      VaultVersionMismatchException - If the token did not match the expected vault version
      VaultConfigLoadException - Generic parse error