Code Monkey home page Code Monkey logo

openpgp-interop's Introduction

OpenPGP interoperability tests

This directory contains simple test cases to read OpenPGP keys and messages generated by a variety of implementations. The tests are declarative, and any implementation can write a driver for these tests to check for interoperability issues.

These test cases are not exhaustive by any means, and should be viewed as a simple check that messages and keys generated by various implementations can interoperate with each other.

Format of a test case

Tests are based on a naming convention. Any file ending with .json is assumed to be a JSON file that declares a new test case. It must have an string field called type that declares the type of test case.

There are currently two types of tests. An import test, and a decrypt test.

Import test

This test expects the implementation to read a public key, validate it, and reject any invalid userids or subkeys. An example JSON file mykey.json

{
  "type" : "import",
  "expected_uids" : ["[email protected]"],
  "expected_fingerprint": "099c5e5d3ca82dac59deb9431446c4a316225086",
  "expected_subkeys" : [{
    "expected_fingerprint": "43c788799304b2737511b41e66d2f1269199e424"
  }]
}

The public key is located by a naming convention, and found in the same directory by replacing the .json extension with .asc. So in this example, the public key to read is mytest.asc within the same directory as the JSON file.

All the fields in the JSON file (except for the type field) are optional. But if a field is present, the implementation must confirm that after validation, it has the same information represented by the field. Unknown fields must be ignored.

expected_uids is an optional array of strings. This contains an array of (validated) UserID strings in the same order as was present in the key.

expected_fingerprint is an optional fingerprint of the primary key.

expected_subkeys is an optional array of objects representing each valid subkey (in the same order as was present in the key.) Each object may also include an optional expected_fingerprint field for the subkey fingerprint.

Decrypt test

This test expects the implementation to decrypt a message using a provided private key, and verify it if (an optional) public key is provided. An example JSON file mymessage.json

{
  "type" : "decrypt",
  "decryptKey": "mymessage-decrypt.asc",
  "passphrase": "test",
  "verifyKey": "mymessage-verify.asc",
  "filename": "hello.txt",
  "timestamp": 1418941207,
  "textcontent": "hello",
}

The message to decrypt is located by a naming convention, and found in the same directory by replacing the .json extension with .asc. So in this example, the message to decrypt is mymessage.asc within the same directory as the JSON file.

decryptKey is a required string field, and is the name of a file within the same directory. This file contains a private key that can decrypt the message.

passphrase is a required string field, and provides a passphrase to unlock the private key.

verifyKey is an optional string field. If present, it is the name of a file within the same directory. This file contains a public key, and the message must be signed by it.

filename is an optional string field that is the filename indicated by the message.

timestamp is an optional numeric field that is the creation timestamp indicated by the message.

textcontent is an optional string field and is the expected content of the file.

Attributions

These test cases are a community effort to improve interoperability between various OpenPGP implementations.

Copyright 2015 The OpenPGP Interoperability Project Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

openpgp-interop's People

Contributors

kbsriram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.