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" | |
13 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
14 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
15 | 14 |
| 15 namespace crypto { |
| 16 class ECPrivateKey; |
| 17 } |
| 18 |
16 namespace net { | 19 namespace net { |
17 | 20 |
18 enum class TokenBindingType { | 21 enum class TokenBindingType { |
19 PROVIDED = 0, | 22 PROVIDED = 0, |
20 REFERRED = 1, | 23 REFERRED = 1, |
21 }; | 24 }; |
22 | 25 |
23 // Takes an exported keying material value |ekm| from the TLS layer, the type of | 26 // Takes an exported keying material value |ekm| from the TLS layer, the type of |
24 // Token Binding |type|, and a token binding key |key| and concatenates the | 27 // Token Binding |type|, and a token binding key |key| and concatenates the |
25 // Token Binding type, key type, and ekm. This concatenation is signed with | 28 // Token Binding type, key type, and ekm. This concatenation is signed with |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // the signature verifies and false if it doesn't or some other error occurs in | 112 // the signature verifies and false if it doesn't or some other error occurs in |
110 // verification. This function is only provided for testing. | 113 // verification. This function is only provided for testing. |
111 NET_EXPORT_PRIVATE bool VerifyTokenBindingSignature(base::StringPiece ec_point, | 114 NET_EXPORT_PRIVATE bool VerifyTokenBindingSignature(base::StringPiece ec_point, |
112 base::StringPiece signature, | 115 base::StringPiece signature, |
113 TokenBindingType type, | 116 TokenBindingType type, |
114 base::StringPiece ekm); | 117 base::StringPiece ekm); |
115 | 118 |
116 } // namespace net | 119 } // namespace net |
117 | 120 |
118 #endif // NET_SSL_TOKEN_BINDING_H_ | 121 #endif // NET_SSL_TOKEN_BINDING_H_ |
OLD | NEW |