java - 等效于 Linux 上的数据保护 API

标签 java .net windows linux security

Microsoft Windows 2000 及更高版本公开了 Data Protection API (DPAPI) 为每个用户或每个系统上下文加密数据。调用者不提供用于加密数据的 key 。相反,数据是使用从用户或系统凭据派生的 key 加密的。

此 API 通过 ProtectedData 在 .NET 中方便地公开类:

// Encrypts the data in a specified byte array and returns a byte array
// that contains the encrypted data.
public static byte[] Protect(
    byte[] userData,
    byte[] optionalEntropy,
    DataProtectionScope scope
)

// Decrypts the data in a specified byte array and returns a byte array
// that contains the decrypted data.
public static byte[] Unprotect(
    byte[] encryptedData,
    byte[] optionalEntropy,
    DataProtectionScope scope
)

Linux 上是否有等效的 API? 一个好处是它可以方便地与 Java 集成。

如果没有其他选择,我有什么选择?

最佳答案

Linux 上的用户级 key 存储有两种选择:

这没有解决对系统级 key 存储的需求。

关于java - 等效于 Linux 上的数据保护 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6032880/

相关文章:

java - 使用 Swagger 获取以单个 JSON 记录的 REST API

java - AChartEngine 运行时错误,NoClassDefFoundError

c# - .NET IL 字节码优化器

windows - 如何在不使用任何可移动磁盘的情况下将文件从主机操作系统传输到虚拟机中运行的操作系统?

java - 使用改造转换特殊 JSON 响应

java - 在哪里可以找到要导入和使用的类 "org.terrier.realtime.memory.MemoryIndex"?

windows - IE9 SmartScreen 警告,尽管遵循所有建议

c++ - 如何在C++ Windows 7下启动/停止WAV声音

c# - MVC4 WebApi 在响应 header 中添加 ETag

c# - 创建报表查看器报表时在另一个数据表中查找值