crypto.getFips()


  • 返回:<number> 如果启用了 FIPS 模式,则为 1,否则为 0。未来的 semver 重大版本可能会将此 API 的返回类型更改为 <boolean>。

在 OpenSSL 3 中,这会报告默认属性查询是否包含 fips=yes。它并不表明 FIPS 提供者已加载或验证。即使请求的加密实现无法获取,因为没有已加载的提供者提供 fips=yes 的匹配,也可能返回 1。详见 FIPS模式。

🌐 With OpenSSL 3, this reports whether the default property query includes fips=yes. It does not establish that a FIPS provider is loaded or validated. It can return 1 even when a requested cryptographic implementation cannot be fetched because no loaded provider supplies a match for fips=yes. See FIPS mode.