这是indexloc提供的服务,不要输入任何密码
crypto: remove ECPrivateKey

There are no remaining users of it.

Bug: 425863216
Change-Id: I96c585c6d2158c3eb7ed6aa2e594fe475f8a7d0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6766336
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Hira Mahmood <hiramahmood@google.com>
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1491506}
NOKEYCHECK=True
GitOrigin-RevId: 2976abe4f5fc74f9c33e43ce4a9b52bb48ccbf92
4 files changed
tree: d9b9db434a5c5908c679ada8671cfb0343963707
  1. apple/
  2. obsolete/
  3. aead.cc
  4. aead.h
  5. aead_unittest.cc
  6. aes_cbc.cc
  7. aes_cbc.h
  8. aes_cbc_unittest.cc
  9. aes_ctr.cc
  10. aes_ctr.h
  11. aes_ctr_unittest.cc
  12. BUILD.gn
  13. chaps_support.cc
  14. chaps_support.h
  15. crypto_export.h
  16. DEPS
  17. DIR_METADATA
  18. evp.cc
  19. evp.h
  20. evp_unittest.cc
  21. features.cc
  22. features.gni
  23. features.h
  24. hash.cc
  25. hash.h
  26. hash_unittest.cc
  27. hkdf.cc
  28. hkdf.h
  29. hmac.cc
  30. hmac.h
  31. hmac_unittest.cc
  32. kdf.cc
  33. kdf.h
  34. kdf_unittest.cc
  35. keypair.cc
  36. keypair.h
  37. keypair_unittest.cc
  38. mac_security_services_lock.cc
  39. mac_security_services_lock.h
  40. nss_crypto_module_delegate.h
  41. nss_key_util.cc
  42. nss_key_util.h
  43. nss_key_util_unittest.cc
  44. nss_util.cc
  45. nss_util.h
  46. nss_util_chromeos.cc
  47. nss_util_internal.h
  48. nss_util_unittest.cc
  49. openssl_util.cc
  50. openssl_util.h
  51. OWNERS
  52. PLAN.md
  53. process_bound_string.cc
  54. process_bound_string.h
  55. process_bound_string_unittest.cc
  56. random.cc
  57. random.h
  58. random_unittest.cc
  59. README.md
  60. rsa_private_key.cc
  61. rsa_private_key.h
  62. rsa_private_key_unittest.cc
  63. scoped_capi_types.h
  64. scoped_cng_types.h
  65. scoped_fake_unexportable_key_provider.cc
  66. scoped_fake_unexportable_key_provider.h
  67. scoped_fake_user_verifying_key_provider.cc
  68. scoped_fake_user_verifying_key_provider.h
  69. scoped_lacontext.h
  70. scoped_lacontext.mm
  71. scoped_nss_types.h
  72. scoped_test_nss_chromeos_user.cc
  73. scoped_test_nss_chromeos_user.h
  74. scoped_test_nss_db.cc
  75. scoped_test_nss_db.h
  76. scoped_test_system_nss_key_slot.cc
  77. scoped_test_system_nss_key_slot.h
  78. secure_hash.cc
  79. secure_hash.h
  80. secure_hash_unittest.cc
  81. secure_util.cc
  82. secure_util.h
  83. sha2.cc
  84. sha2.h
  85. sha2_unittest.cc
  86. sign.cc
  87. sign.h
  88. sign_unittest.cc
  89. signature_verifier.cc
  90. signature_verifier.h
  91. signature_verifier_unittest.cc
  92. subtle_passkey.cc
  93. subtle_passkey.h
  94. test_support.cc
  95. test_support.h
  96. unexportable_key.cc
  97. unexportable_key.h
  98. unexportable_key_mac.h
  99. unexportable_key_mac.mm
  100. unexportable_key_mac_unittest.mm
  101. unexportable_key_metrics.cc
  102. unexportable_key_metrics.h
  103. unexportable_key_metrics_unittest.cc
  104. unexportable_key_software_unsecure.cc
  105. unexportable_key_unittest.cc
  106. unexportable_key_win.cc
  107. unexportable_key_win.h
  108. user_verifying_key.cc
  109. user_verifying_key.h
  110. user_verifying_key_mac.mm
  111. user_verifying_key_mac_unittest.mm
  112. user_verifying_key_win.cc
README.md

//crypto README

This directory contains implementations of crypto primitives for use in Chromium. Most of these are either:

  • Wrappers around platform-specific APIs (DPAPI, libsecret, etc), so that code elsewhere in Chromium can use cross-platform abstractions, or
  • Wrappers around BoringSSL APIs that use Chromium-native types like base::span and similar

There is very little actual cryptographic code in //crypto - it is mostly wrappers.

This directory is actively being refactored as of 2025-06. See PLAN.md.

Commonly-Used Interfaces

Many interfaces in this directory are deprecated and being changed or removed; check the comment at the top of the header file before using them.

Advice For Clients

  • Ciphertext, keys, certificates, and other cryptographic material are generally sequences of bytes, not characters, so prefer using byte-oriented types to represent them: vector<uint8_t>, array<uint8_t>, and span<uint8_t> rather than string and string_view.
  • To serialize private keys, use keypair::PrivateKey::ToPrivateKeyInfo(), which returns a PKCS#8 PrivateKeyInfo structure serialized as a byte vector. To unserialize keys in this format, use keypair::PrivateKey::FromPrivateKeyInfo().
  • To serialize public keys, use keypair::PublicKey::ToSubjectPublicKeyInfo() or keypair::PrivateKey::ToSubjectPublicKeyInfo(), which return a X.509 SubjectPublicKeyInfo structure serialized as a byte vector. To unserialize public keys in this format, use keypair::PublicKey::FromPublicKeyInfo().
  • SubjectPublicKeyInfo and PrivateKeyInfo can represent many kinds of keys, so code that expects a specific kind of key must check the kind after deserialization.
  • To serialize symmetric keys (AEAD, HMAC, or symmetric encryption keys), use a raw sequence of bytes for the key material. Represent these keys in memory using vector<uint8_t>, array<uint8_t>, or span<uint8_t> directly.