OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SSL_TOKEN_BINDING_H_ | 5 #ifndef NET_SSL_TOKEN_BINDING_H_ |
6 #define NET_SSL_TOKEN_BINDING_H_ | 6 #define NET_SSL_TOKEN_BINDING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 #include "crypto/ec_private_key.h" | 12 #include "crypto/ec_private_key.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 // Given a vector of serialized TokenBinding structs (as defined in | 18 // Given a vector of serialized TokenBinding structs (as defined in |
19 // draft-ietf-tokbind-protocol-02), this function combines them to form the | 19 // draft-ietf-tokbind-protocol-04), this function combines them to form the |
20 // serialized TokenBindingMessage struct in |*out|. This function returns a net | 20 // serialized TokenBindingMessage struct in |*out|. This function returns a net |
21 // error. | 21 // error. |
22 // | 22 // |
23 // struct { | 23 // struct { |
24 // TokenBinding tokenbindings<0..2^16-1>; | 24 // TokenBinding tokenbindings<0..2^16-1>; |
25 // } TokenBindingMessage; | 25 // } TokenBindingMessage; |
26 Error BuildTokenBindingMessageFromTokenBindings( | 26 Error BuildTokenBindingMessageFromTokenBindings( |
27 const std::vector<base::StringPiece>& token_bindings, | 27 const std::vector<base::StringPiece>& token_bindings, |
28 std::string* out); | 28 std::string* out); |
29 | 29 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // |ec_point| as the public key. Returns true if the signature verifies and | 85 // |ec_point| as the public key. Returns true if the signature verifies and |
86 // false if it doesn't or some other error occurs in verification. This function | 86 // false if it doesn't or some other error occurs in verification. This function |
87 // is only provided for testing. | 87 // is only provided for testing. |
88 NET_EXPORT_PRIVATE bool VerifyEKMSignature(base::StringPiece ec_point, | 88 NET_EXPORT_PRIVATE bool VerifyEKMSignature(base::StringPiece ec_point, |
89 base::StringPiece signature, | 89 base::StringPiece signature, |
90 base::StringPiece ekm); | 90 base::StringPiece ekm); |
91 | 91 |
92 } // namespace net | 92 } // namespace net |
93 | 93 |
94 #endif // NET_SSL_TOKEN_BINDING_H_ | 94 #endif // NET_SSL_TOKEN_BINDING_H_ |
OLD | NEW |