Index: components/gcm_driver/crypto/p256_key_util_openssl.cc |
diff --git a/components/gcm_driver/crypto/p256_key_util_openssl.cc b/components/gcm_driver/crypto/p256_key_util_openssl.cc |
index e550b15f3d6e2bebbcdef16eb1fb592da3dda8fe..848e5d3d1caf8f3a385c69300aece7122b7ef2d0 100644 |
--- a/components/gcm_driver/crypto/p256_key_util_openssl.cc |
+++ b/components/gcm_driver/crypto/p256_key_util_openssl.cc |
@@ -10,6 +10,8 @@ |
#include <openssl/ecdh.h> |
#include <openssl/evp.h> |
+#include "base/base64url.h" |
+ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/strings/string_util.h" |
@@ -45,6 +47,16 @@ bool ComputeSharedP256Secret(const base::StringPiece& private_key, |
return false; |
} |
+ std::vector<uint8_t> pubkey; |
+ local_key_pair->ExportPublicKey(&pubkey); |
+ |
+ std::string res(reinterpret_cast<char*>(pubkey.data()), pubkey.size()); |
+ |
+ std::string b; |
+ base::Base64UrlEncode(res, base::Base64UrlEncodePolicy::OMIT_PADDING, &b); |
+ |
+ LOG(INFO) << "x509 key: [" << b << "]"; |
+ |
crypto::ScopedEC_KEY ec_private_key( |
EVP_PKEY_get1_EC_KEY(local_key_pair->key())); |