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_
18 #include "metadata-internals.h"
19 #include "domain-internals.h"
20 #include "tokentype.h"
24 #include "reflection.h"
25 #include "tabledefs.h"
26 #include <mono/metadata/icalls.h>
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)
38 MONO_METADATA_SECURITY_OK
= 0x00,
39 MONO_METADATA_INHERITANCEDEMAND_CLASS
= 0x01,
40 MONO_METADATA_INHERITANCEDEMAND_METHOD
= 0x02
44 MONO_SECURITY_MODE_NONE
,
45 MONO_SECURITY_MODE_CORE_CLR
,
51 MonoClass
*securitymanager
; /* System.Security.SecurityManager */
52 } MonoSecurityManager
;
54 gboolean
mono_is_ecma_key (const char *publickey
, int size
);
55 MonoMethod
* mono_get_context_capture_method (void);
57 MonoSecurityManager
* mono_security_manager_get_methods (void);
60 void mono_security_set_mode (MonoSecurityMode mode
);
61 MonoSecurityMode
mono_security_get_mode (void);
65 MonoBoolean
ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void);
68 void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value
);
70 #ifndef DISABLE_SECURITY
71 #define mono_security_core_clr_enabled() (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
73 #define mono_security_core_clr_enabled() (FALSE)
76 #endif /* _MONO_METADATA_SECURITY_MANAGER_H_ */