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 gpointer mono_security_principal_windows_identity_get_current_token (void); 30 extern MonoArray* ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token); 31 extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (MonoError *error); 32 extern MonoStringHandle ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token, MonoError *error); 33 extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoStringHandle username, MonoError *error); 34 35 36 /* System.Security.Principal.WindowsImpersonationContext */ 37 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token); 38 extern gpointer ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token); 39 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token); 40 extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void); 41 42 43 /* System.Security.Principal.WindowsPrincipal */ 44 extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group); 45 extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group); 46 47 48 /* Mono.Security.Cryptography.KeyPairPersistance */ 49 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root); 50 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path); 51 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path); 52 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path); 53 extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path); 54 55 56 /* System.Security.Policy.Evidence */ 57 MonoBoolean ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent (MonoReflectionAssemblyHandle refass, MonoError *error); 58 59 /* System.Security.SecureString */ 60 extern void ves_icall_System_Security_SecureString_DecryptInternal (MonoArray *data, MonoObject *scope); 61 extern void ves_icall_System_Security_SecureString_EncryptInternal (MonoArray *data, MonoObject *scope); 62 void invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gboolean encrypt, MonoError *error); 63 64 G_END_DECLS 65 66 #endif /* _MONO_METADATA_SECURITY_H_ */ 67