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

Side by Side Diff: net/base/x509_certificate.h

Issue 7384002: Added CreateOriginBound method to x509_certificate.h. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Cleaned up the Threadsafe OID singleton wrapper class. Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/x509_certificate_nss.cc » ('j') | net/base/x509_certificate_nss.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BASE_X509_CERTIFICATE_H_ 5 #ifndef NET_BASE_X509_CERTIFICATE_H_
6 #define NET_BASE_X509_CERTIFICATE_H_ 6 #define NET_BASE_X509_CERTIFICATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // 1. Encryption without authentication and thus vulnerable to 180 // 1. Encryption without authentication and thus vulnerable to
181 // man-in-the-middle attacks. 181 // man-in-the-middle attacks.
182 // 2. Self-signed certificates cannot be revoked. 182 // 2. Self-signed certificates cannot be revoked.
183 // 183 //
184 // Use this certificate only after the above risks are acknowledged. 184 // Use this certificate only after the above risks are acknowledged.
185 static X509Certificate* CreateSelfSigned(crypto::RSAPrivateKey* key, 185 static X509Certificate* CreateSelfSigned(crypto::RSAPrivateKey* key,
186 const std::string& subject, 186 const std::string& subject,
187 uint32 serial_number, 187 uint32 serial_number,
188 base::TimeDelta valid_duration); 188 base::TimeDelta valid_duration);
189 189
190 // Create an origin bound certificate containing the public key in |key|.
191 // Subject, web origin, serial number and validity period are given as
wtc 2011/08/19 18:18:08 Remove "Subject, " from this line. Remove lines 1
mdietz 2011/08/22 20:09:00 Done.
192 // parameters. The certificate is signed by the private key in |key|.
193 // The hashing algorithm for the signature is SHA-1.
194 //
195 // |subject| is a distinguished name defined in RFC4514.
196 //
197 // An example:
198 // CN=Michael Wong,O=FooBar Corporation,DC=foobar,DC=com
199 //
200 // See Internet Draft draft-balfanz-tls-obc-00 for more details:
201 // http://balfanz.github.com/tls-obc-spec/draft-balfanz-tls-obc-00.html
202 static X509Certificate* CreateOriginBound(crypto::RSAPrivateKey* key,
203 const std::string& subject,
204 const std::string& origin,
205 uint32 serial_number,
206 base::TimeDelta valid_duration);
207
190 // Appends a representation of this object to the given pickle. 208 // Appends a representation of this object to the given pickle.
191 void Persist(Pickle* pickle); 209 void Persist(Pickle* pickle);
192 210
193 // The subject of the certificate. For HTTPS server certificates, this 211 // The subject of the certificate. For HTTPS server certificates, this
194 // represents the web server. The common name of the subject should match 212 // represents the web server. The common name of the subject should match
195 // the host name of the web server. 213 // the host name of the web server.
196 const CertPrincipal& subject() const { return subject_; } 214 const CertPrincipal& subject() const { return subject_; }
197 215
198 // The issuer of the certificate. 216 // The issuer of the certificate.
199 const CertPrincipal& issuer() const { return issuer_; } 217 const CertPrincipal& issuer() const { return issuer_; }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 // (Marked mutable because it's used in a const method.) 493 // (Marked mutable because it's used in a const method.)
476 mutable base::Lock verification_lock_; 494 mutable base::Lock verification_lock_;
477 #endif 495 #endif
478 496
479 DISALLOW_COPY_AND_ASSIGN(X509Certificate); 497 DISALLOW_COPY_AND_ASSIGN(X509Certificate);
480 }; 498 };
481 499
482 } // namespace net 500 } // namespace net
483 501
484 #endif // NET_BASE_X509_CERTIFICATE_H_ 502 #endif // NET_BASE_X509_CERTIFICATE_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/x509_certificate_nss.cc » ('j') | net/base/x509_certificate_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698