S2OPC OPCUA Toolkit
sopc_user.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
32 #ifndef SOPC_USER_H_
33 #define SOPC_USER_H_
34 
35 #include <stdbool.h>
36 
37 #include "sopc_builtintypes.h"
38 
40 typedef struct SOPC_User SOPC_User;
41 
45 bool SOPC_User_IsLocal(const SOPC_User* user);
46 
50 bool SOPC_User_IsAnonymous(const SOPC_User* user);
51 
60 
69 
75 
77 bool SOPC_User_IsUsername(const SOPC_User* user);
78 
84 
90 
93 
95 bool SOPC_User_Equal(const SOPC_User* left, const SOPC_User* right);
96 
98 void SOPC_User_Free(SOPC_User** ppUser);
99 
102 
111 const char* SOPC_User_ToCString(const SOPC_User* user);
112 
113 #endif /* SOPC_USER_H_ */
SOPC_User_GetCertificate
const SOPC_ByteString * SOPC_User_GetCertificate(const SOPC_User *user)
Returns a reference to the internal storage of the DER certificate. The user shall be a user with a c...
SOPC_User
struct SOPC_User SOPC_User
Logged in (successfully) user structure.
Definition: sopc_user.h:40
SOPC_User_IsAnonymous
bool SOPC_User_IsAnonymous(const SOPC_User *user)
Returns true if the user is an anonymous user.
SOPC_User_IsCertificate
bool SOPC_User_IsCertificate(const SOPC_User *user)
Returns true if the type of the user is certificate.
SOPC_User_Copy
SOPC_User * SOPC_User_Copy(const SOPC_User *user)
Copy the given user.
sopc_builtintypes.h
SOPC_String
This structure provides string encapsulation.
Definition: sopc_builtintypes.h:148
SOPC_User_ToCString
const char * SOPC_User_ToCString(const SOPC_User *user)
Returns the user as a const C string description:
SOPC_User_GetAnonymous
const SOPC_User * SOPC_User_GetAnonymous(void)
Returns an anonymous user, which shall not be freed nor be modified.
SOPC_User_CreateCertificate
SOPC_User * SOPC_User_CreateCertificate(SOPC_ByteString *certificateData)
Creates a SOPC_User which has a X509 certificate.
SOPC_User_IsUsername
bool SOPC_User_IsUsername(const SOPC_User *user)
Returns true if the type of the user is username.
SOPC_User_GetCertificate_Thumbprint
const SOPC_String * SOPC_User_GetCertificate_Thumbprint(const SOPC_User *user)
Returns a reference to the internal storage of the thumbprint certificate (SHA1 hexadecimal format)....
SOPC_User_IsLocal
bool SOPC_User_IsLocal(const SOPC_User *user)
Returns true if the user is a local user.
SOPC_User_CreateUsername
SOPC_User * SOPC_User_CreateUsername(SOPC_String *username)
Creates a SOPC_User which has a usename.
SOPC_User_Equal
bool SOPC_User_Equal(const SOPC_User *left, const SOPC_User *right)
Returns true if the users are the same type and content (if applicable)
SOPC_User_GetLocal
const SOPC_User * SOPC_User_GetLocal(void)
Returns a local user, which shall not be freed nor be modified.
SOPC_User_GetUsername
const SOPC_String * SOPC_User_GetUsername(const SOPC_User *user)
Returns a reference to the internal storage of the username. The user must be a user with a username.
SOPC_User_Free
void SOPC_User_Free(SOPC_User **ppUser)
User deletion, should not be called on local and anonymous users.