2 * security-manager.h: Security Manager
5 * Sebastien Pouliot <sebastien@ximian.com>
7 * Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
10 #ifndef _MONO_METADATA_SECURITY_MANAGER_H_
11 #define _MONO_METADATA_SECURITY_MANAGER_H_
16 #include "metadata-internals.h"
17 #include "domain-internals.h"
18 #include "tokentype.h"
22 #include "reflection.h"
23 #include "tabledefs.h"
28 #define MONO_ECMA_KEY_LENGTH 16
29 #define MONO_PUBLIC_KEY_HEADER_LENGTH 32
30 #define MONO_MINIMUM_PUBLIC_KEY_LENGTH 48
31 #define MONO_DEFAULT_PUBLIC_KEY_LENGTH 128
33 #define MONO_PUBLIC_KEY_BIT_SIZE(x) ((x - MONO_PUBLIC_KEY_HEADER_LENGTH) << 3)
36 MONO_METADATA_SECURITY_OK
= 0x00,
37 MONO_METADATA_INHERITANCEDEMAND_CLASS
= 0x01,
38 MONO_METADATA_INHERITANCEDEMAND_METHOD
= 0x02
42 MONO_SECURITY_MODE_NONE
,
43 MONO_SECURITY_MODE_CORE_CLR
,
44 MONO_SECURITY_MODE_CAS
,
45 MONO_SECURITY_MODE_SMCS_HACK
51 MonoClass
*securitymanager
; /* System.Security.SecurityManager */
52 MonoMethod
*demand
; /* SecurityManager.InternalDemand */
53 MonoMethod
*demandchoice
; /* SecurityManager.InternalDemandChoice */
54 MonoMethod
*demandunmanaged
; /* SecurityManager.DemandUnmanaged */
55 MonoMethod
*inheritancedemand
; /* SecurityManager.InheritanceDemand */
56 MonoMethod
*inheritsecurityexception
; /* SecurityManager.InheritanceDemandSecurityException */
57 MonoMethod
*linkdemand
; /* SecurityManager.LinkDemand */
58 MonoMethod
*linkdemandfulltrust
; /* SecurityManager.LinkDemandFullTrust */
59 MonoMethod
*linkdemandunmanaged
; /* SecurityManager.LinkDemandUnmanaged */
60 MonoMethod
*linkdemandsecurityexception
;/* SecurityManager.LinkDemandSecurityException */
62 MonoClass
*allowpartiallytrustedcallers
; /* System.Security.AllowPartiallyTrustedCallersAttribute */
63 MonoClass
*suppressunmanagedcodesecurity
; /* System.Security.SuppressUnmanagedCodeSecurityAttribute */
64 } MonoSecurityManager
;
66 /* Initialization/utility functions */
67 void mono_activate_security_manager (void) MONO_INTERNAL
;
68 gboolean
mono_is_security_manager_active (void) MONO_INTERNAL
;
69 MonoSecurityManager
* mono_security_manager_get_methods (void) MONO_INTERNAL
;
70 gboolean
mono_is_ecma_key (const char *publickey
, int size
) MONO_INTERNAL
;
71 MonoMethod
* mono_get_context_capture_method (void) MONO_INTERNAL
;
73 void mono_secman_inheritancedemand_class (MonoClass
*klass
, MonoClass
*parent
) MONO_INTERNAL
;
74 void mono_secman_inheritancedemand_method (MonoMethod
*override
, MonoMethod
*base
) MONO_INTERNAL
;
77 void mono_security_set_mode (MonoSecurityMode mode
) MONO_INTERNAL
;
78 MonoSecurityMode
mono_security_get_mode (void) MONO_INTERNAL
;
81 MonoBoolean
ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void) MONO_INTERNAL
;
82 void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value
) MONO_INTERNAL
;
83 MonoBoolean
ves_icall_System_Security_SecurityManager_get_CheckExecutionRights (void) MONO_INTERNAL
;
84 void ves_icall_System_Security_SecurityManager_set_CheckExecutionRights (MonoBoolean value
) MONO_INTERNAL
;
85 MonoBoolean
ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity (MonoReflectionMethod
*m
, MonoDeclSecurityActions
*kactions
, MonoDeclSecurityActions
*mactions
) MONO_INTERNAL
;
88 #endif /* _MONO_METADATA_SECURITY_MANAGER_H_ */