语言支持的密钥类型

下表列出了每个基元支持的密钥类型(按语言分类)。

AEAD

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
AES-GCM 1
AES-GCM-SIV 2
AES-CTR-HMAC
AES-EAX
KMS 信封
CHACHA20-POLY1305
XCHACHA20-POLY1305

流式 AEAD

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
AES-GCM-HKDF-STREAMING
AES-CTR-HMAC-STREAMING

确定性 AEAD

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
AES-SIV

MAC

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
HMAC-SHA2
AES-CMAC

PRF

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
HKDF-SHA2
HMAC-SHA2
AES-CMAC

签名

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
ECDSA 对比 NIST 曲线
Ed25519
RSA-SSA-PKCS1
RSA-SSA-PSS

混合加密

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
惠普克
采用 AEAD 和 HKDF 的 ECIES 3
采用 DeterministicAEAD 和 HKDF 的 ECIES 4

JWT MAC

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
JWT HMAC-SHA2

JWT 签名

实施步骤 Java C++
(BoringSSL)
C++
(OpenSSL)
Objective-C Go Python
基于 NIST 曲线的 JWT ECDSA
JWT RSA-SSA-PKCS1
JWT RSA-SSA-PSS

  1. AES-GCM 无法在 Android 19 以下版本的设备上正常运行

  2. 要求安装 Conscrypt 作为 JCE 安全提供程序。

  3. 需要 NIST 曲线。

  4. 需要 NIST 曲线。