From 861872499e875cecffaed648d785b4eceded51e8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 2 Sep 2016 14:25:07 -0600 Subject: [PATCH] update readme --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bce2826..7b54bde 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,11 @@ See [Help Wanted: Database Plugins (for saving certs)](https://github.com/Daplie How to create a custom strategy =============================== -Let's say there's some new database AwesomeDB that +READ THIS README: +Believe it or not, most of your answers are either right here +or in the comments in the sample code in `index.js`. + +Now, let's say there's some new database AwesomeDB that we want to make a plugin for, here's how we'd start: ```bash @@ -19,6 +23,7 @@ git clone git@github.com:AwesomeDB/le-store-awesome.git pushd le-store-awesome +# IMPORTANT: we pull in the 'template' branch, which has the skeleton code git pull https://github.com/Daplie/le-store-SPEC.git template git push @@ -68,7 +73,27 @@ versions of the private and/or public keys when being passed to the `*Keypair` f `privateKeyPem`, `publicKeyPem`, and `privateKeyJwk`. It's easy to generate `publicKeyJwk` from `privateKeyJwk` because it is just a copy of the public fields `e` and `n`. +``` +// keypair looks like this +{ privateKeyPem: '...' +, publicKeyPem: '...' +, privateKeyJwk: { ... } +} +``` + **check** `checkKeypair` may be called with any of `email`, `accountId`, and `keypair` - which will contain only `publicKeyPem` and `publicKeyJwk`. + +``` +// opts looks like this +{ + email: '...@...' +, accountId: '...' +, keypair: { + publicKeyPem: '...' + , publicKeyJwk: { ... } + } +} +```