it is ready!
This commit is contained in:
parent
ffb130ec0a
commit
550bcc484a
45
README.md
45
README.md
|
@ -197,21 +197,28 @@ var certStore = {
|
||||||
The Goodies
|
The Goodies
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{ newRegUrl: '...' // no defaults, specify LeCore.nproductionServerUrl
|
|
||||||
|
|
||||||
// Accounts
|
// Accounts
|
||||||
LeCore.registerNewAccount(options, cb) // returns (err, acmeUrls={newReg,newAuthz,newCert,revokeCert})
|
LeCore.registerNewAccount(options, cb) // returns (err, acmeUrls={newReg,newAuthz,newCert,revokeCert})
|
||||||
|
|
||||||
{ newRegUrl: '...' // no defaults, specify LeCore.newAuthz
|
{ newRegUrl: '<url>' // no defaults, specify acmeUrls.newAuthz
|
||||||
, email: '...' // valid email (server checks MX records)
|
, email: '<email>' // valid email (server checks MX records)
|
||||||
, agreeToTerms: fn (tosUrl, cb) {} // callback to allow user interaction for tosUrl
|
, accountPrivateKeyPem: '<ASCII PEM>' // callback to allow user interaction for tosUrl
|
||||||
// cb(err=null, agree=tosUrl) // must specify agree=tosUrl to continue (or falsey to end)
|
, agreeToTerms: fn (tosUrl, cb) {} // must specify agree=tosUrl to continue (or falsey to end)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Registration
|
// Registration
|
||||||
LeCore.getCertificate(options, cb)
|
LeCore.getCertificate(options, cb) // returns (err, pems={ key, cert, ca })
|
||||||
|
|
||||||
{ newAuthzUrl: '...' // no defaults, specify acmeUrls.newAuthz
|
{ newAuthzUrl: '<url>' // specify acmeUrls.newAuthz
|
||||||
|
, newCertUrl: '<url>' // specify acmeUrls.newCert
|
||||||
|
|
||||||
|
, domainPrivateKeyPem: '<ASCII PEM>'
|
||||||
|
, accountPrivateKeyPem: '<ASCII PEM>'
|
||||||
|
, domains: ['example.com']
|
||||||
|
|
||||||
|
, setChallenge: fn (hostname, key, val, cb)
|
||||||
|
, removeChallenge: fn (hostname, key, cb)
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Helpers & Stuff
|
Helpers & Stuff
|
||||||
|
@ -229,10 +236,10 @@ LeCore.knownEndpoints // new-authz, new-cert, new-reg, revok
|
||||||
|
|
||||||
// HTTP Client Helpers
|
// HTTP Client Helpers
|
||||||
LeCore.Acme // Signs requests with JWK
|
LeCore.Acme // Signs requests with JWK
|
||||||
acme = new Acme(lePrivateKey) // privateKey format is abstract
|
acme = new Acme(lePrivateKey) // privateKey format is abstract
|
||||||
acme.post(url, body, cb) // POST with signature
|
acme.post(url, body, cb) // POST with signature
|
||||||
acme.parseLinks(link) // (internal) parses 'link' header
|
acme.parseLinks(link) // (internal) parses 'link' header
|
||||||
acme.getNonce(url, cb) // (internal) HEAD request to get 'replay-nonce' strings
|
acme.getNonce(url, cb) // (internal) HEAD request to get 'replay-nonce' strings
|
||||||
|
|
||||||
// Note: some of these are not async,
|
// Note: some of these are not async,
|
||||||
// but they will be soon. Don't rely
|
// but they will be soon. Don't rely
|
||||||
|
@ -240,12 +247,12 @@ LeCore.Acme // Signs requests with JWK
|
||||||
|
|
||||||
// Crypto Helpers
|
// Crypto Helpers
|
||||||
LeCore.leCrypto
|
LeCore.leCrypto
|
||||||
generateRsaKeypair(bitLen, exponent, cb); // returns { privateKeyPem, privateKeyJwk, publicKeyPem, publicKeyMd5 }
|
generateRsaKeypair(bitLen, exponent, cb); // returns { privateKeyPem, privateKeyJwk, publicKeyPem, publicKeyMd5 }
|
||||||
thumbprint(lePubKey) // generates public key thumbprint
|
thumbprint(lePubKey) // generates public key thumbprint
|
||||||
generateSignature(lePrivKey, bodyBuf, nonce) // generates a signature
|
generateSignature(lePrivKey, bodyBuf, nonce) // generates a signature
|
||||||
privateJwkToPems(jwk) // { n: '...', e: '...', iq: '...', ... } to PEMs
|
privateJwkToPems(jwk) // { n: '...', e: '...', iq: '...', ... } to PEMs
|
||||||
privatePemToJwk // PEM to JWK (see line above)
|
privatePemToJwk // PEM to JWK (see line above)
|
||||||
importPemPrivateKey(privateKeyPem) // (internal) returns abstract private key
|
importPemPrivateKey(privateKeyPem) // (internal) returns abstract private key
|
||||||
```
|
```
|
||||||
|
|
||||||
For testing and development, you can also inject the dependencies you want to use:
|
For testing and development, you can also inject the dependencies you want to use:
|
||||||
|
|
Loading…
Reference in New Issue