Code Monkey home page Code Monkey logo

relaydev's Introduction

relaydev: Development tools for implementers of the Relaynet Protocol Suite

This command-line application is a thin wrapper around the Relaynet core library for Node.js and it contains a series of utilities aimed at implementers of the Relaynet protocol suite. If you're porting Relaynet to a new programming language or platform, you may want to check the input and output of your implementation against these utilities.

Relaynet couriers, service providers or end users do not need to use this software at all.

Install

You must have Node.js 10 or newer to use this software. To get the latest stable version, run:

npm install -g @relaycorp/relaydev

And to get or upgrade to the latest development version, run:

npm install -g @relaycorp/relaydev@dev

relaydev CLI

To learn how to use a sub-command, run it without arguments or with the --help option.

key: Key management

relaydev key gen-rsa: Generate an RSA key

For example, run the following to inspect the generated key:

relaydev key gen-rsa | openssl rsa -check -in - -inform DER -noout -text

relaydev key gen-ecdh: Generate an ECDH key

For example, run the following to inspect the generated key:

relaydev key gen-ecdh | openssl pkey -in - -inform DER -noout -text

relaydev key get-rsa-pub: Derive the public key of an RSA private key

For example, run the following to inspect the extracted public key:

relaydev key gen-rsa | \
  relaydev key get-rsa-pub | \
  openssl rsa -in - -inform DER -pubin -noout -text

relaydev cert issue: Issue a Relaynet PKI Certificate

For example, the following will create a self-issued gateway certificate that expires the following week:

END_DATE="$(date --date='next week' --iso-8601=seconds)"
relaydev key gen-rsa > key.der

openssl rsa -in key.der -inform DER -pubout -outform DER | \
  relaydev cert issue --type=gateway --end-date="${END_DATE}" key.der \
  > cert.der

relaydev cert inspect: Inspect a Relaynet PKI Certificate

For example, to inspect the certificate cert.der, run:

relaydev cert inspect < cert.der

relaydev ramf serialize: Create and serialize a RAMF message

For example, run the following to create a cargo cargo.ramf whose payload is contained in the file cargo-message-set.cms:

cat cargo-message-set.cms | relaydev ramf serialize cargo \
    --recipient-address=https://example.com \
    --sender-key=key.der \
    --sender-cert=cert.der \
    > cargo.ramf

relaydev ramf deserialize: Deserialize and validate a RAMF message

For example, to inspect the cargo message created above, run:

relaydev ramf deserialize < cargo.ramf

Development

If you're contributing to this package, after installing it locally with npm install, make sure to run npm run build:dev to transpile the TypeScript code and make the relaydev script available in your $PATH -- you'll have to re-run that whenever you want to check your changes.

To run the functional tests, run npm test. Note you'll need the following dependencies in your $PATH to run the tests:

  • openssl
  • jq

relaydev's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar gnarea avatar

Watchers

 avatar  avatar

relaydev's Issues

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.