docs: function jwe ( details ) {
    if (!details.header)
      throw new Error('No header for JWE token')
    if (!details.header.alg || details.header.alg != 'dir')
      throw new Error('Only "dir" algorithm supported for JWE token')
    if (!details.header.enc)
      throw new Error('No JWE encryption algorithm specified')
    if (!encryptAlg[details.header.enc])
      throw new Error('Unsupported JWE encryption algorithm:"'+details.header.enc+'"')
    if (!details.payload)
      throw new Error('No payload for JWE token')
    if (!details.credentials)
      throw new Error('No credentials for JWE token')
    if (!details.credentials.kid)
      throw new Error('No credentials.kid for JWE token')
    if (!details.credentials.key)
      throw new Error('No credentials.key for JWE token')
    return encryptAlg[details.header.enc]( details )
  }