{
  "protocol": "pgp",
  "imports": [
    {
      "path": "common.avdl",
      "type": "idl"
    },
    {
      "path": "identify_common.avdl",
      "type": "idl"
    }
  ],
  "types": [
    {
      "type": "enum",
      "name": "SignMode",
      "symbols": [
        "ATTACHED_0",
        "DETACHED_1",
        "CLEAR_2"
      ]
    },
    {
      "type": "record",
      "name": "PGPSignOptions",
      "fields": [
        {
          "type": "string",
          "name": "keyQuery"
        },
        {
          "type": "SignMode",
          "name": "mode"
        },
        {
          "type": "boolean",
          "name": "binaryIn"
        },
        {
          "type": "boolean",
          "name": "binaryOut"
        }
      ]
    },
    {
      "type": "record",
      "name": "PGPEncryptOptions",
      "fields": [
        {
          "type": {
            "type": "array",
            "items": "string"
          },
          "name": "recipients"
        },
        {
          "type": "boolean",
          "name": "noSign"
        },
        {
          "type": "boolean",
          "name": "noSelf"
        },
        {
          "type": "boolean",
          "name": "binaryOut"
        },
        {
          "type": "string",
          "name": "keyQuery"
        }
      ]
    },
    {
      "type": "record",
      "name": "PGPSigVerification",
      "fields": [
        {
          "type": "boolean",
          "name": "isSigned"
        },
        {
          "type": "boolean",
          "name": "verified"
        },
        {
          "type": "User",
          "name": "signer"
        },
        {
          "type": "PublicKey",
          "name": "signKey"
        }
      ],
      "doc": "PGPSigVerification is returned by pgpDecrypt and pgpVerify with information\n    about a the signature verification. If isSigned is false, there was no\n    signature, and the rest of the fields should be ignored."
    },
    {
      "type": "record",
      "name": "PGPDecryptOptions",
      "fields": [
        {
          "type": "boolean",
          "name": "assertSigned"
        },
        {
          "type": "string",
          "name": "signedBy"
        }
      ]
    },
    {
      "type": "record",
      "name": "PGPVerifyOptions",
      "fields": [
        {
          "type": "string",
          "name": "signedBy"
        },
        {
          "type": "bytes",
          "name": "signature"
        }
      ]
    },
    {
      "type": "record",
      "name": "KeyInfo",
      "fields": [
        {
          "type": "string",
          "name": "fingerprint"
        },
        {
          "type": "string",
          "name": "key"
        },
        {
          "type": "string",
          "name": "desc"
        }
      ]
    },
    {
      "type": "record",
      "name": "PGPQuery",
      "fields": [
        {
          "type": "boolean",
          "name": "secret"
        },
        {
          "type": "string",
          "name": "query"
        },
        {
          "type": "boolean",
          "name": "exactMatch"
        }
      ]
    },
    {
      "type": "record",
      "name": "PGPCreateUids",
      "fields": [
        {
          "type": "boolean",
          "name": "useDefault"
        },
        {
          "type": {
            "type": "array",
            "items": "PGPIdentity"
          },
          "name": "ids"
        }
      ],
      "lint": "ignore"
    },
    {
      "type": "record",
      "name": "PGPPurgeRes",
      "fields": [
        {
          "type": {
            "type": "array",
            "items": "string"
          },
          "name": "filenames"
        }
      ],
      "doc": "Export all pgp keys in lksec, then if doPurge is true, remove the keys from lksec."
    }
  ],
  "messages": {
    "pgpSign": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "source",
          "type": "Stream"
        },
        {
          "name": "sink",
          "type": "Stream"
        },
        {
          "name": "opts",
          "type": "PGPSignOptions"
        }
      ],
      "response": null
    },
    "pgpPull": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "userAsserts",
          "type": {
            "type": "array",
            "items": "string"
          }
        }
      ],
      "response": null,
      "doc": "Download PGP keys for tracked users and update the local GPG keyring.\n    If usernames is nonempty, update only those users."
    },
    "pgpEncrypt": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "source",
          "type": "Stream"
        },
        {
          "name": "sink",
          "type": "Stream"
        },
        {
          "name": "opts",
          "type": "PGPEncryptOptions"
        }
      ],
      "response": null
    },
    "pgpDecrypt": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "source",
          "type": "Stream"
        },
        {
          "name": "sink",
          "type": "Stream"
        },
        {
          "name": "opts",
          "type": "PGPDecryptOptions"
        }
      ],
      "response": "PGPSigVerification"
    },
    "pgpVerify": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "source",
          "type": "Stream"
        },
        {
          "name": "opts",
          "type": "PGPVerifyOptions"
        }
      ],
      "response": "PGPSigVerification"
    },
    "pgpImport": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "key",
          "type": "bytes"
        },
        {
          "name": "pushSecret",
          "type": "boolean"
        }
      ],
      "response": null
    },
    "pgpExport": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "options",
          "type": "PGPQuery"
        }
      ],
      "response": {
        "type": "array",
        "items": "KeyInfo"
      },
      "doc": "Exports active PGP keys. Only allows armored export."
    },
    "pgpExportByFingerprint": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "options",
          "type": "PGPQuery"
        }
      ],
      "response": {
        "type": "array",
        "items": "KeyInfo"
      }
    },
    "pgpExportByKID": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "options",
          "type": "PGPQuery"
        }
      ],
      "response": {
        "type": "array",
        "items": "KeyInfo"
      }
    },
    "pgpKeyGen": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "primaryBits",
          "type": "int"
        },
        {
          "name": "subkeyBits",
          "type": "int"
        },
        {
          "name": "createUids",
          "type": "PGPCreateUids"
        },
        {
          "name": "allowMulti",
          "type": "boolean"
        },
        {
          "name": "doExport",
          "type": "boolean"
        },
        {
          "name": "pushSecret",
          "type": "boolean"
        }
      ],
      "response": null,
      "lint": "ignore"
    },
    "pgpKeyGenDefault": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "createUids",
          "type": "PGPCreateUids"
        }
      ],
      "response": null,
      "lint": "ignore"
    },
    "pgpDeletePrimary": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null
    },
    "pgpSelect": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "fingerprintQuery",
          "type": "string"
        },
        {
          "name": "allowMulti",
          "type": "boolean"
        },
        {
          "name": "skipImport",
          "type": "boolean"
        },
        {
          "name": "onlyImport",
          "type": "boolean"
        }
      ],
      "response": null,
      "doc": "Select an existing key and add to Keybase."
    },
    "pgpUpdate": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "all",
          "type": "boolean"
        },
        {
          "name": "fingerprints",
          "type": {
            "type": "array",
            "items": "string"
          }
        }
      ],
      "response": null,
      "doc": "Push updated key(s) to the server."
    },
    "pgpPurge": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        },
        {
          "name": "doPurge",
          "type": "boolean"
        }
      ],
      "response": "PGPPurgeRes"
    },
    "pgpStorageDismiss": {
      "request": [
        {
          "name": "sessionID",
          "type": "int"
        }
      ],
      "response": null,
      "doc": "Dismiss the PGP unlock via secret_store_file notification."
    }
  },
  "namespace": "keybase.1"
}