blob: b5cc5038b96a02545c87c66a706557e50bad515c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_BASE_X509_UTIL_NSS_H_
#define NET_BASE_X509_UTIL_NSS_H_
#pragma once
#include <string>
#include "base/time.h"
typedef struct CERTCertificateStr CERTCertificate;
typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey;
typedef struct SECKEYPublicKeyStr SECKEYPublicKey;
namespace net {
namespace x509_util {
// Creates a self-signed certificate containing |public_key|. Subject, serial
// number and validity period are given as parameters. The certificate is
// signed by |private_key|. The hashing algorithm for the signature is SHA-1.
// |subject| is a distinguished name defined in RFC4514.
CERTCertificate* CreateSelfSignedCert(
SECKEYPublicKey* public_key,
SECKEYPrivateKey* private_key,
const std::string& subject,
uint32 serial_number,
base::Time not_valid_before,
base::Time not_valid_after);
} // namespace x509_util
} // namespace net
#endif // NET_BASE_X509_UTIL_NSS_H_
|