index.js
function redisSetAccount(options, reg, callback) {
    _debug('le-store-redis.redisSetAccount', '\nregistration:', reg);
    var accountId = 'account-' + crypto.createHash('sha256')
      .update(reg.keypair.publicKeyPem).digest('hex');
    var account = _.cloneDeep(reg);
    account.id = accountId;
    account.accountId = accountId;
    account.email = options.email;
    account.agreeTos = options.agreeTos || reg.agreeTos;

    var jsonAccount = JSON.stringify(account);

    async.parallel([
      function(callback) {
        return client.set(accountId, jsonAccount, callback);
      },
      function(callback) {
        if(account.email) {
          return _createIndex('idx-e2a', account.email, account.id, callback);
        }
        callback(null, 'NOP');
      }], function(err, results) {
        if(err) {
          return callback(err);
        }
        if(results[0] !== null && results[1] !== null) {
          callback(null, account);
        }
    });
  }
function redisSetAccount(options, reg, callback) {
    _debug('le-store-redis.redisSetAccount', '\nregistration:', reg);
    var accountId = 'account-' + crypto.createHash('sha256')
      .update(reg.keypair.publicKeyPem).digest('hex');
    var account = _.cloneDeep(reg);
    account.id = accountId;
    account.accountId = accountId;
    account.email = options.email;
    account.agreeTos = options.agreeTos || reg.agreeTos;

    var jsonAccount = JSON.stringify(account);

    async.parallel([
      function(callback) {
        return client.set(accountId, jsonAccount, callback);
      },
      function(callback) {
        if(account.email) {
          return _createIndex('idx-e2a', account.email, account.id, callback);
        }
        callback(null, 'NOP');
      }], function(err, results) {
        if(err) {
          return callback(err);
        }
        if(results[0] !== null && results[1] !== null) {
          callback(null, account);
        }
    });
  }
function redisSetAccount ( options , reg , callback ) { _debug ( 'le-store-redis.redisSetAccount' , '\nregistration:' , reg ) ; var accountId = 'account-' + crypto . createHash ( 'sha256' ) . update ( reg . keypair . publicKeyPem ) . digest ( 'hex' ) ; var account = _ . cloneDeep ( reg ) ; account . id = accountId ; account . accountId = accountId ; account . email = options . email ; account . agreeTos = options . agreeTos || reg . agreeTos ; var jsonAccount = JSON . stringify ( account ) ; async . parallel ( [ function ( callback ) { return client . set ( accountId , jsonAccount , callback ) ; } , function ( callback ) { if ( account . email ) { return _createIndex ( 'idx-e2a' , account . email , account . id , callback ) ; } callback ( null , 'NOP' ) ; } ] , function ( err , results ) { if ( err ) { return callback ( err ) ; } if ( results [ 0 ] !== null && results [ 1 ] !== null ) { callback ( null , account ) ; } } ) ; }
Stores an account in the database.

@param {Object[]} options - options passed to storage called
@param {string} options[].email - email address associated with
registration.
@param {Object[]} reg - ACME registration information.
@param {string} reg[].keypair - keypair used for registration.
@param {string} reg[].receipt - ACME registration receipt.
@param {Function} callback(err, account) - called after storage attempt.
Stores an account in the database .