Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Keyring

somogyi-google edited this page Dec 16, 2014 · 2 revisions

Overview

The current End-to-End Keyring implementation was created at a time when we expected to only have a static key management model. As the project has evolved we've found that design is hard to modify and extend.

To solve this problem, as well as facilitate the integration with the keyserver and other key distribution strategies, this design proposal aims to refactor it so we can more easily accept external contributions and integrations, as well as facilitate the use of the library by third parties.

This will be done by splitting the keyring functionality into public and secret key services, and have different providers for each. Adding a new provider will be relatively straightforward and the Context will be able to expose some of this APIs through its import/export APIs.

Public Key Services

The public key services are those that provide storage and discovery of keys (both locally and remotely). For starters we expect to have two (manual key import, and transparency key server), but other clients might need other services.

Implementations

  • Manually Imported / Verified Keys
  • Transparency Backend Key Server / Client
  • Alternate Systems

API

  • SearchKey(opt_emailAddress, opt_arguments)

    • Request:
      • email address (optional)
        • if no email provided, return all keys owned by user
      • arguments (optional)
        • auth credentials
    • Response:
      • public key
  • UpdateKey(emailAddress, opt_publicKey, opt_arguments)

    • Request:
      • email address
      • public key (optional)
        • empty = delete
      • arguments (optional - for key servers)
      • auth credentials
      • self-revocation signature
    • Response:
      • registered public key

Secret Key Services

The secret key services are those that provide key generation, storage, and signing and decryption services. All secret key transfer strategies are implemented within this API. The APIs exposed here act on a cryptographic primitive format (eg, RSA PKCS EME 1.5) and for starters will include secret keys managed by end-to-end as well as WebCrypto, Hardware and in the future potentially other secret key managers.

Implementations

  • E2E-managed keys
  • 4880 File Import
  • Secret Paper Import
  • Key Server Rotation
  • uKey Key Syncer
  • WebCrypto
  • Hardware
  • External Key Manager (GnuPG bridge, other hardware, network oracle etc..)

API

  • GetStatus()
    • Response:
      • status
      • encrypted
      • has passphrase
  • GenerateKey(emailAddress, type, opt_arguments)
    • Request:
      • email address
      • type (sign, or encrypt)
      • arguments (optional)
    • Response:
      • public key
      • secret key handle
  • GetKeyImportOptions(opt_emailAddress)
    • Request:
      • email address (optional)
    • Response:
      • key import options
  • ImportKey(keyImportOption)
    • Request:
      • key import option
    • Response:
      • list of secret key handles
      • list of public keys
  • GetKeyExportOptions(opt_secretKeyHandle)
    • Request:
      • secret key handle (optional)
    • Response:
      • key export options
  • ExportKey(keyExportOption)
    • Request:
      • key export option
  • DeleteKey(secretKeyHandle)
    • Request:
      • secret key handle
  • Sign(secretKeyHandle, dataToSign)
    • Request:
      • secret key handle
      • data to sign
    • Response:
      • signature
  • Decrypt(secretKeyHandle, dataToDecrypt)
    • Request:
      • secret key handle
      • data to decrypt
    • Response:
      • decrypted data
Clone this wiki locally