OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_BASE_X509_UTIL_NSS_H_ |
| 6 #define NET_BASE_X509_UTIL_NSS_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/time.h" |
| 12 |
| 13 typedef struct CERTCertificateStr CERTCertificate; |
| 14 typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey; |
| 15 typedef struct SECKEYPublicKeyStr SECKEYPublicKey; |
| 16 |
| 17 |
| 18 namespace net { |
| 19 |
| 20 namespace x509_util { |
| 21 |
| 22 // Creates a self-signed certificate containing |public_key|. Subject, serial |
| 23 // number and validity period are given as parameters. The certificate is |
| 24 // signed by |private_key|. The hashing algorithm for the signature is SHA-1. |
| 25 // |subject| is a distinguished name defined in RFC4514. |
| 26 CERTCertificate* CreateSelfSignedCert( |
| 27 SECKEYPublicKey* public_key, |
| 28 SECKEYPrivateKey* private_key, |
| 29 const std::string& subject, |
| 30 uint32 serial_number, |
| 31 base::TimeDelta valid_duration); |
| 32 |
| 33 } // namespace x509_util |
| 34 |
| 35 } // namespace net |
| 36 |
| 37 #endif // NET_BASE_X509_UTIL_NSS_H_ |
OLD | NEW |