Skip to content

Latest commit

 

History

History
78 lines (46 loc) · 1.73 KB

File metadata and controls

78 lines (46 loc) · 1.73 KB
title User GPG Keys

{% if page.version == 'dotcom' %}

GPG Keys

{{#tip}}

APIs for managing user GPG keys are currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the blog post for full details.

To access the API you must provide a custom media type in the Accept header:

  application/vnd.github.cryptographer-preview

{{/tip}}

{:toc}

List your GPG keys

GET /user/gpg_keys

Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key scope.

Response

<%= headers 200, :pagination => default_pagination_rels %> <%= json(:gpg_key) { |h| [h] } %>

Get a single GPG key

View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least read:gpg_key scope.

GET /user/gpg_keys/:id

Response

<%= headers 200 %> <%= json :gpg_key %>

Create a GPG key

Creates a GPG key. Requires that you are authenticated via Basic Auth, or OAuth with at least write:gpg_key scope.

POST /user/gpg_keys

Input

<%= json :armored_public_key => "-----BEGIN PGP PUBLIC KEY BLOCK-----\n...\n-----END PGP PUBLIC KEY BLOCK-----" %>

Response

<%= headers 201, :Location => get_resource(:gpg_key)['url'] %> <%= json :gpg_key %>

Delete a GPG key

Removes a GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least admin:gpg_key scope.

DELETE /user/gpg_keys/:id

Response

<%= headers 204 %>

{% endif %}