{
  "iface": "futoin.secvault.keys",
  "version": "0.3",
  "ftn3rev": "1.9",
  "imports": [
    "futoin.secvault.types:0.3"
  ],
  "funcs": {
    "unlock": {
      "params": {
        "secret": "KeyData"
      },
      "result": "boolean",
      "throws": [
        "InvalidSecret"
      ]
    },
    "lock": {
      "result": "boolean"
    },
    "generateKey": {
      "params": {
        "ext_id": "ExtID",
        "usage": "KeyUsage",
        "key_type": "KeyType",
        "gen_params": "GenParams"
      },
      "result": "KeyID",
      "throws": [
        "UnsupportedType",
        "OrigMismatch"
      ]
    },
    "injectKey": {
      "params": {
        "ext_id": "ExtID",
        "usage": "KeyUsage",
        "key_type": "KeyType",
        "gen_params": "GenParams",
        "data": "KeyData"
      },
      "result": "KeyID",
      "throws": [
        "UnsupportedType",
        "OrigMismatch",
        "InvalidKey"
      ]
    },
    "injectEncryptedKey": {
      "params": {
        "ext_id": "ExtID",
        "usage": "KeyUsage",
        "key_type": "KeyType",
        "gen_params": "GenParams",
        "data": "KeyData",
        "enc_key": "KeyID",
        "mode": "CipherMode"
      },
      "result": "KeyID",
      "throws": [
        "UnsupportedType",
        "OrigMismatch",
        "UnknownKeyID",
        "NotApplicable",
        "InvalidKey"
      ]
    },
    "deriveKey": {
      "params": {
        "ext_id": "ExtID",
        "usage": "KeyUsage",
        "key_type": "KeyType",
        "gen_params": "GenParams",
        "base_key": "KeyID",
        "kdf": "KeyDerivationFunction",
        "hash": "HashType",
        "salt": "KeyData",
        "other": "map"
      },
      "result": "KeyID",
      "throws": [
        "UnknownKeyID",
        "UnsupportedKey",
        "UnsupportedDerivation",
        "InvalidParams",
        "NotApplicable",
        "OrigMismatch"
      ]
    },
    "wipeKey": {
      "params": {
        "id": "KeyID"
      },
      "result": "boolean"
    },
    "exposeKey": {
      "params": {
        "id": "KeyID"
      },
      "result": "KeyData",
      "throws": [
        "UnknownKeyID",
        "NotApplicable"
      ]
    },
    "encryptedKey": {
      "params": {
        "id": "KeyID",
        "enc_key": "KeyID",
        "mode": "CipherMode"
      },
      "result": "KeyData",
      "throws": [
        "UnknownKeyID",
        "NotApplicable"
      ]
    },
    "pubEncryptedKey": {
      "params": {
        "id": "KeyID",
        "pubkey": "PublicKey"
      },
      "result": "KeyData",
      "throws": [
        "UnknownKeyID",
        "NotApplicable"
      ]
    },
    "publicKey": {
      "params": {
        "id": "KeyID"
      },
      "result": "PublicKey",
      "throws": [
        "UnknownKeyID",
        "NotApplicable"
      ]
    },
    "keyInfo": {
      "params": {
        "id": "KeyID"
      },
      "result": "KeyInfo",
      "throws": [
        "UnknownKeyID"
      ]
    },
    "extKeyInfo": {
      "params": {
        "ext_id": "ExtID"
      },
      "result": "KeyInfo",
      "throws": [
        "UnknownKeyID"
      ]
    },
    "listKeys": {
      "result": "KeyIDList"
    }
  },
  "requires": [
    "SecureChannel",
    "BinaryData"
  ]
}