summaryrefslogtreecommitdiffstats
path: root/crypto/ec_private_key.h
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 04:21:09 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 04:21:09 +0000
commit550cee900473ff9d964a9c4d18e1b3670391967b (patch)
tree20a03e6d39a2274c831b0fe121ad0c7f14b1c688 /crypto/ec_private_key.h
parent115bee94449b0594f797973aa05992bbbd6c61d3 (diff)
downloadchromium_src-550cee900473ff9d964a9c4d18e1b3670391967b.zip
chromium_src-550cee900473ff9d964a9c4d18e1b3670391967b.tar.gz
chromium_src-550cee900473ff9d964a9c4d18e1b3670391967b.tar.bz2
Support EC certs in OriginBoundCertService and OriginBoundCertStore.
OriginBoundCertService::GetOriginBoundCert takes a vector of requested cert types in order of preferrence and will return or generate one of an acceptable type. BUG=88782 TEST=net_unittests, unit_tests Review URL: http://codereview.chromium.org/8662036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/ec_private_key.h')
-rw-r--r--crypto/ec_private_key.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/ec_private_key.h b/crypto/ec_private_key.h
index 0d287de..44f754b 100644
--- a/crypto/ec_private_key.h
+++ b/crypto/ec_private_key.h
@@ -18,6 +18,7 @@
typedef struct evp_pkey_st EVP_PKEY;
#else
// Forward declaration.
+typedef struct CERTSubjectPublicKeyInfoStr CERTSubjectPublicKeyInfo;
typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey;
typedef struct SECKEYPublicKeyStr SECKEYPublicKey;
#endif
@@ -65,6 +66,22 @@ class CRYPTO_EXPORT ECPrivateKey {
const std::vector<uint8>& encrypted_private_key_info,
const std::vector<uint8>& subject_public_key_info);
+#if !defined(USE_OPENSSL)
+ // Imports the key pair and returns in |public_key| and |key|.
+ // Shortcut for code that needs to keep a reference directly to NSS types
+ // without having to create a ECPrivateKey object and make a copy of them.
+ // TODO(mattm): move this function to some NSS util file.
+ static bool ImportFromEncryptedPrivateKeyInfo(
+ const std::string& password,
+ const uint8* encrypted_private_key_info,
+ size_t encrypted_private_key_info_len,
+ CERTSubjectPublicKeyInfo* decoded_spki,
+ bool permanent,
+ bool sensitive,
+ SECKEYPrivateKey** key,
+ SECKEYPublicKey** public_key);
+#endif
+
#if defined(USE_OPENSSL)
EVP_PKEY* key() { return key_; }
#else