open62541 1.4.15
Open source implementation of OPC UA
Loading...
Searching...
No Matches
pki.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2018 (c) Mark Giraud, Fraunhofer IOSB
6 */
7
8#ifndef UA_PLUGIN_PKI_H_
9#define UA_PLUGIN_PKI_H_
10
11#include <open62541/types.h>
14
16
17
18
21
23 void *context;
24
25 /* Verify the certificate against the configured policies and trust chain. */
27 const UA_ByteString *certificate);
28
29 /* Verify that the certificate has the applicationURI in the subject name. */
31 const UA_ByteString *certificate,
32 const UA_String *applicationURI);
33
34 /* Get the expire date from certificate */
35 UA_StatusCode (*getExpirationDate)(UA_DateTime *expiryDateTime,
36 UA_ByteString *certificate);
37
39 UA_ByteString *certificate);
40
41 /* Delete the certificate verification context */
43
44 /* Pointer to logging pointer in the server/client configuration. If the
45 * logging pointer is changed outside of the plugin, the new logger is used
46 * automatically*/
48};
49
50/** Decrypt a private key in PEM format using a password. The output is the key
51 * in the binary DER format. Also succeeds if the PEM private key does not
52 * require a password or is already in the DER format. The outDerKey memory is
53 * allocated internally.
54 *
55 * Returns UA_STATUSCODE_BADSECURITYCHECKSFAILED if the password is wrong. */
56UA_EXPORT UA_StatusCode
58 const UA_ByteString password,
59 UA_ByteString *outDerKey);
60
62
63#endif /* UA_PLUGIN_PKI_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:100
#define _UA_END_DECLS
Definition config.h:107
UA_EXPORT UA_StatusCode UA_PKI_decryptPrivateKey(const UA_ByteString privateKey, const UA_ByteString password, UA_ByteString *outDerKey)
Decrypt a private key in PEM format using a password.
UA_StatusCode(* getSubjectName)(UA_String *subjectName, UA_ByteString *certificate)
Definition pki.h:38
UA_StatusCode(* verifyApplicationURI)(const UA_CertificateVerification *cv, const UA_ByteString *certificate, const UA_String *applicationURI)
Definition pki.h:30
UA_StatusCode(* getExpirationDate)(UA_DateTime *expiryDateTime, UA_ByteString *certificate)
Definition pki.h:35
const UA_Logger * logging
Definition pki.h:47
void(* clear)(UA_CertificateVerification *cv)
Definition pki.h:42
UA_StatusCode(* verifyCertificate)(const UA_CertificateVerification *cv, const UA_ByteString *certificate)
Definition pki.h:26
uint32_t UA_StatusCode
Definition types.h:82