Merge pull request #4781 from kumpera/unaligned-cleanup-1
[mono.git] / mono / metadata / security.h
1 /**
2  * \file
3  * Security internal calls
4  *
5  * Author:
6  *      Sebastien Pouliot  <sebastien@ximian.com>
7  *
8  * (C) 2004 Novell (http://www.novell.com)
9  */
10
11
12 #ifndef _MONO_METADATA_SECURITY_H_
13 #define _MONO_METADATA_SECURITY_H_
14
15 #include <glib.h>
16 #include <mono/metadata/object.h>
17 #include <mono/metadata/object-internals.h>
18 #include <mono/utils/mono-compiler.h>
19 #include <mono/utils/mono-error.h>
20 #include <mono/utils/mono-publib.h>
21
22 G_BEGIN_DECLS
23
24 /* System.Environment */
25 extern MonoStringHandle ves_icall_System_Environment_get_UserName (MonoError *error);
26
27
28 /* System.Security.Principal.WindowsIdentity */
29 extern MonoArray* ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token);
30 extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void);
31 extern MonoString* ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token);
32 extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *username);
33
34
35 /* System.Security.Principal.WindowsImpersonationContext */
36 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token);
37 extern gpointer ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token);
38 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token);
39 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void);
40
41
42 /* System.Security.Principal.WindowsPrincipal */
43 extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group);
44 extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group);
45
46
47 /* Mono.Security.Cryptography.KeyPairPersistance */
48 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root);
49 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path);
50 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path);
51 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path);
52 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path);
53
54
55 /* System.Security.Policy.Evidence */
56 MonoBoolean ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent (MonoReflectionAssemblyHandle refass, MonoError *error);
57
58 /* System.Security.SecureString */
59 extern void ves_icall_System_Security_SecureString_DecryptInternal (MonoArray *data, MonoObject *scope);
60 extern void ves_icall_System_Security_SecureString_EncryptInternal (MonoArray *data, MonoObject *scope);
61 void invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gboolean encrypt, MonoError *error);
62
63 G_END_DECLS
64
65 #endif /* _MONO_METADATA_SECURITY_H_ */