NvdClient

class NvdClient(connectTimeoutSeconds: Long = 10, readTimeoutSeconds: Long = 20, apiKey: String? = System.getenv("NVD_API_KEY"), client: OkHttpClient = OkHttpClient.Builder() .connectTimeout(connectTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(readTimeoutSeconds, TimeUnit.SECONDS) .build(), baseUrl: String = "https://services.nvd.nist.gov/rest/json/cves/2.0", requestDelayMs: Long = if (System.getenv("NVD_API_KEY") != null) 100 else 600)

Constructors

Link copied to clipboard
constructor(connectTimeoutSeconds: Long = 10, readTimeoutSeconds: Long = 20, apiKey: String? = System.getenv("NVD_API_KEY"), client: OkHttpClient = OkHttpClient.Builder() .connectTimeout(connectTimeoutSeconds, TimeUnit.SECONDS) .readTimeout(readTimeoutSeconds, TimeUnit.SECONDS) .build(), baseUrl: String = "https://services.nvd.nist.gov/rest/json/cves/2.0", requestDelayMs: Long = if (System.getenv("NVD_API_KEY") != null) 100 else 600)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun getCveById(cveId: String): NvdCve?
Link copied to clipboard
fun getVulnerabilities(dependencies: List<ParsedDependency>, verbose: Boolean = false): Map<String, List<Vulnerability>>
Link copied to clipboard
fun searchByCpe(cpeString: String, retries: Int = 0): List<NvdCve>
Link copied to clipboard
fun searchByKeyword(keyword: String, limit: Int = 20, retries: Int = 0): List<NvdCve>