open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
create_certificate.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "open62541pp/config.hpp"
6
7#if UAPP_HAS_CREATE_CERTIFICATE
8
9namespace opcua::crypto {
10
12 DER,
13 PEM,
14};
15
20
21/**
22 * Create a self-signed X.509 v3 certificate.
23 *
24 * It is recommended to store the generated certificate on disk for reuse, so the application can be
25 * recognized across several executions.
26 *
27 * @note Only available with open62541 >= v1.3 and OpenSSL/LibreSSL
28 *
29 * @param subject Elements for the subject,
30 * e.g. {"C=DE", "O=SampleOrganization", "CN=Open62541Server@localhost"}
31 * @param subjectAltName Elements for SubjectAltName,
32 * e.g. {"DNS:localhost", "URI:urn:open62541.server.application"}
33 * @param certificateFormat Certificate format, either DER or PEM
34 *
35 * @exception BadStatus (BadOutOfMemory)
36 * @exception CreateCertificateError
37 *
38 * @see UA_CreateCertificate
39 */
41 Span<const String> subject,
42 Span<const String> subjectAltName,
44);
45
46} // namespace opcua::crypto
47
48#endif // if UAPP_HAS_CREATE_CERTIFICATE
UA_ByteString wrapper class.
Definition types.hpp:490
View to a contiguous sequence of objects, similar to std::span in C++20.
Definition span.hpp:26
CreateCertificateResult createCertificate(Span< const String > subject, Span< const String > subjectAltName, CertificateFormat certificateFormat=CertificateFormat::DER)
Create a self-signed X.509 v3 certificate.