Pass the --clr-memory-model flag on the command line instead of MONO_DEBUG so its...
[mono-project.git] / mono / metadata / security-manager.h
blobb3b798739bafb52a298e206a7f5f908a19d4730b
1 /**
2 * \file
3 * Security Manager
5 * Author:
6 * Sebastien Pouliot <sebastien@ximian.com>
8 * Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
9 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
12 #ifndef _MONO_METADATA_SECURITY_MANAGER_H_
13 #define _MONO_METADATA_SECURITY_MANAGER_H_
15 #include <string.h>
17 #include "object.h"
18 #include "metadata-internals.h"
19 #include "domain-internals.h"
20 #include "tokentype.h"
21 #include "threads.h"
22 #include "marshal.h"
23 #include "image.h"
24 #include "reflection.h"
25 #include "tabledefs.h"
26 #include <mono/metadata/icalls.h>
28 /* Definitions */
30 #define MONO_ECMA_KEY_LENGTH 16
31 #define MONO_PUBLIC_KEY_HEADER_LENGTH 32
32 #define MONO_MINIMUM_PUBLIC_KEY_LENGTH 48
33 #define MONO_DEFAULT_PUBLIC_KEY_LENGTH 128
35 #define MONO_PUBLIC_KEY_BIT_SIZE(x) ((x - MONO_PUBLIC_KEY_HEADER_LENGTH) << 3)
37 enum {
38 MONO_METADATA_SECURITY_OK = 0x00,
39 MONO_METADATA_INHERITANCEDEMAND_CLASS = 0x01,
40 MONO_METADATA_INHERITANCEDEMAND_METHOD = 0x02
43 typedef enum {
44 MONO_SECURITY_MODE_NONE,
45 MONO_SECURITY_MODE_CORE_CLR,
46 } MonoSecurityMode;
48 /* Structures */
50 typedef struct {
51 MonoClass *securitymanager; /* System.Security.SecurityManager */
52 } MonoSecurityManager;
54 gboolean mono_is_ecma_key (const char *publickey, int size);
56 MonoSecurityManager* mono_security_manager_get_methods (void);
58 /* Security mode */
59 void mono_security_set_mode (MonoSecurityMode mode);
60 MonoSecurityMode mono_security_get_mode (void);
62 /* internal calls */
63 ICALL_EXPORT
64 MonoBoolean ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void);
66 ICALL_EXPORT
67 void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value);
69 #ifndef DISABLE_SECURITY
70 #define mono_security_core_clr_enabled() (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
71 #else
72 #define mono_security_core_clr_enabled() (FALSE)
73 #endif
75 #endif /* _MONO_METADATA_SECURITY_MANAGER_H_ */