Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CERT_X509_UTIL_H_ | 5 #ifndef NET_CERT_X509_UTIL_H_ |
| 6 #define NET_CERT_X509_UTIL_H_ | 6 #define NET_CERT_X509_UTIL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 class X509Certificate; | 24 class X509Certificate; |
| 25 | 25 |
| 26 namespace x509_util { | 26 namespace x509_util { |
| 27 | 27 |
| 28 // Supported digest algorithms for signing certificates. | 28 // Supported digest algorithms for signing certificates. |
| 29 enum DigestAlgorithm { | 29 enum DigestAlgorithm { |
| 30 DIGEST_SHA1, | 30 DIGEST_SHA1, |
| 31 DIGEST_SHA256 | 31 DIGEST_SHA256 |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 // Microsoft User Principal Name: 1.3.6.1.4.1.311.20.2.3 | |
| 35 const uint8_t kUpnOid[] = {0x2b, 0x6, 0x1, 0x4, 0x1, | |
| 36 0x82, 0x37, 0x14, 0x2, 0x3}; | |
|
Ryan Sleevi
2016/02/27 00:38:45
I don't like exposing the constant's value in the
Kevin Cernekee
2016/02/27 19:06:23
Done.
| |
| 37 | |
| 34 // Creates a public-private keypair and a self-signed certificate. | 38 // Creates a public-private keypair and a self-signed certificate. |
| 35 // Subject, serial number and validity period are given as parameters. | 39 // Subject, serial number and validity period are given as parameters. |
| 36 // The certificate is signed by the private key in |key|. The key length and | 40 // The certificate is signed by the private key in |key|. The key length and |
| 37 // signature algorithm may be updated periodically to match best practices. | 41 // signature algorithm may be updated periodically to match best practices. |
| 38 // | 42 // |
| 39 // |subject| is a distinguished name defined in RFC4514 with _only_ a CN | 43 // |subject| is a distinguished name defined in RFC4514 with _only_ a CN |
| 40 // component, as in: | 44 // component, as in: |
| 41 // CN=Michael Wong | 45 // CN=Michael Wong |
| 42 // | 46 // |
| 43 // SECURITY WARNING | 47 // SECURITY WARNING |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 | 91 |
| 88 private: | 92 private: |
| 89 base::Time now_; | 93 base::Time now_; |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 } // namespace x509_util | 96 } // namespace x509_util |
| 93 | 97 |
| 94 } // namespace net | 98 } // namespace net |
| 95 | 99 |
| 96 #endif // NET_CERT_X509_UTIL_H_ | 100 #endif // NET_CERT_X509_UTIL_H_ |
| OLD | NEW |