docs: function _jwsFromManifest(manifest, body) {
      assert.object(manifest, 'manifest');
      assert.buffer(body, 'body');
  
      var formatLength;
      var formatTail;
      var jws = {
          signatures: []
      };
  
      for (var i = 0; i < manifest.signatures.length; i++) {
          var sig = manifest.signatures[i];
  
          try {
              var protectedHeader = JSON.parse(
                  base64url.decode(sig['protected']));
          } catch (protectedErr) {
              throw new restifyErrors.InvalidContentError(protectedErr, fmt(
                  'could not parse manifest "signatures[%d].protected": %j',
                  i, sig['protected']));
          }
          if (isNaN(protectedHeader.formatLength)) {
              throw new restifyErrors.InvalidContentError(fmt(
                  'invalid "formatLength" in "signatures[%d].protected": %j',
                  i, protectedHeader.formatLength));
          } else if (formatLength === undefined) {
              formatLength = protectedHeader.formatLength;
          } else if (protectedHeader.formatLength !== formatLength) {
              throw new restifyErrors.InvalidContentError(fmt(
                  'conflicting "formatLength" in "signatures[%d].protected": %j',
                  i, protectedHeader.formatLength));
          }
  
          if (!protectedHeader.formatTail ||
              typeof (protectedHeader.formatTail) !== 'string')
          {
              throw new restifyErrors.InvalidContentError(fmt(
                  'missing "formatTail" in "signatures[%d].protected"', i));
          }
          var formatTail_ = base64url.decode(protectedHeader.formatTail);
          if (formatTail === undefined) {
              formatTail = formatTail_;
          } else if (formatTail_ !== formatTail) {
              throw new restifyErrors.InvalidContentError(fmt(
                  'conflicting "formatTail" in "signatures[%d].protected": %j',
                  i, formatTail_));
          }
  
          var jwsSig = {
              header: {
                  alg: sig.header.alg,
                  chain: sig.header.chain
              },
              signature: sig.signature,
              'protected': sig['protected']
          };
          if (sig.header.jwk) {
              try {
                  jwsSig.header.jwk = jwkToPem(sig.header.jwk);
              } catch (jwkErr) {
                  throw new restifyErrors.InvalidContentError(jwkErr, fmt(
                      'error in "signatures[%d].header.jwk": %s',
                      i, jwkErr.message));
              }
          }
          jws.signatures.push(jwsSig);
      }
  
      jws.payload = Buffer.concat([
          body.slice(0, formatLength),
          new Buffer(formatTail)
      ]);
  
      return jws;
  }