Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: net/cert/x509_util.h

Issue 21561003: Add a utility method to convert SPKI from DER to JWK, so far implemented only for EC P256v1 (which … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@domain-bound-public-key
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/cert/x509_util_nss.cc » ('j') | net/cert/x509_util_nss.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_util.h
diff --git a/net/cert/x509_util.h b/net/cert/x509_util.h
index 8a6bae2c95fb7d40719535fabc7d674d15c6e87c..99694679a002e10f60fd36f10c3cc3850c150824 100644
--- a/net/cert/x509_util.h
+++ b/net/cert/x509_util.h
@@ -8,9 +8,14 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "base/strings/string_piece.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace crypto {
class ECPrivateKey;
class RSAPrivateKey;
@@ -45,6 +50,13 @@ NET_EXPORT_PRIVATE bool CreateDomainBoundCertEC(
base::Time not_valid_after,
std::string* der_cert);
+// Converts a subject public key info from DER to JWK.
+// See http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-13 for
+// the output format.
+NET_EXPORT_PRIVATE bool ConvertSPKIFromDERToJWK(
+ base::StringPiece spki,
Ryan Sleevi 2013/08/02 23:08:43 "const base::StringPiece&" [Yes, I realize there i
+ base::DictionaryValue* public_key_jwk);
+
// Create a self-signed certificate containing the public key in |key|.
// Subject, serial number and validity period are given as parameters.
// The certificate is signed by the private key in |key|. The hashing
« no previous file with comments | « no previous file | net/cert/x509_util_nss.cc » ('j') | net/cert/x509_util_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698