lib/jwt.js
function jws ( details ) {
  if (!details.header)
    throw new Error('No header for JWS token')
  if (!details.header.alg)
    throw new Error('No JWS signing algorithm specified')
  if (!signAlg[details.header.alg])
    throw new Error('Unsupported JWS signing algorithm:"'+details.header.alg+'"')
  if (!details.payload)
    throw new Error('No payload for JWS token')
  if (!details.credentials)
    throw new Error('No credentials for JWS token')
  if (!details.credentials.kid)
    throw new Error('No credentials.kid for JWS token')
  if (!details.credentials.key)
    throw new Error('No credentials.key for JWS token')
  return signAlg[details.header.alg]( details )
}
function jws ( details ) {
  if (!details.header)
    throw new Error('No header for JWS token')
  if (!details.header.alg)
    throw new Error('No JWS signing algorithm specified')
  if (!signAlg[details.header.alg])
    throw new Error('Unsupported JWS signing algorithm:"'+details.header.alg+'"')
  if (!details.payload)
    throw new Error('No payload for JWS token')
  if (!details.credentials)
    throw new Error('No credentials for JWS token')
  if (!details.credentials.kid)
    throw new Error('No credentials.kid for JWS token')
  if (!details.credentials.key)
    throw new Error('No credentials.key for JWS token')
  return signAlg[details.header.alg]( details )
}
function jws ( details ) { if ( ! details . header ) throw new Error ( 'No header for JWS token' ) if ( ! details . header . alg ) throw new Error ( 'No JWS signing algorithm specified' ) if ( ! signAlg [ details . header . alg ] ) throw new Error ( 'Unsupported JWS signing algorithm:"' + details . header . alg + '"' ) if ( ! details . payload ) throw new Error ( 'No payload for JWS token' ) if ( ! details . credentials ) throw new Error ( 'No credentials for JWS token' ) if ( ! details . credentials . kid ) throw new Error ( 'No credentials.kid for JWS token' ) if ( ! details . credentials . key ) throw new Error ( 'No credentials.key for JWS token' ) return signAlg [ details . header . alg ] ( details ) }
make a JWS
make a JWS