1////////////////////////////////////////////////////////////////////////////////
2//
3//  ADOBE SYSTEMS INCORPORATED
4//  Copyright 2010 Adobe Systems Incorporated
5//  All Rights Reserved.
6//
7//  NOTICE: Adobe permits you to use, modify, and distribute this file
8//  in accordance with the terms of the license agreement accompanying it.
9//
10////////////////////////////////////////////////////////////////////////////////
11
12package mx.core
13{
14
15/**
16 *  A Class that describes configuration data for an RSL.
17 *
18 *  @langversion 3.0
19 *  @playerversion Flash 10.2
20 *  @playerversion AIR 2.5
21 *  @productversion Flex 4.5
22 */
23public class RSLData
24{
25    include "../core/Version.as";
26
27    //--------------------------------------------------------------------------
28    //
29    //  Constructor
30    //
31    //--------------------------------------------------------------------------
32
33    /**
34     *  Constructor.
35     *
36     *  @param rslURL The location of the RSL.
37     *  @param policyFileURL The location of the policy file url (optional).
38     *  @param digest The digest of the RSL. This is null for an RSL without
39     *  a digest.
40     *  @param hashType The type of hash used to create the digest. The only
41     *  supported value is <code>SHA256.TYPE_ID</code>.
42     *  @param isSigned True if the RSL has been signed by Adobe, false
43     *  otherwise.
44     *  @param verifyDigest Detemines if the RSL's digest should be verified
45     *  after it is loaded.
46     *  @param applicationDomainTarget The application domain where the the
47     *  RSL should be loaded. For valid values see the ApplicationDomainTarget
48     *  enumeration.
49     *
50     *  @see mx.core.ApplicationDomainTarget
51     *
52     *  @langversion 3.0
53     *  @playerversion Flash 10.2
54     *  @playerversion AIR 2.5
55     *  @productversion Flex 4.5
56     */
57    public function RSLData(rslURL:String = null,
58                            policyFileURL:String = null,
59                            digest:String = null,
60                            hashType:String = null,
61                            isSigned:Boolean = false,
62                            verifyDigest:Boolean = false,
63                            applicationDomainTarget:String = "default")
64    {
65        super();
66
67        _rslURL = rslURL
68        _policyFileURL = policyFileURL;
69        _digest = digest;
70        _hashType = hashType;
71        _isSigned = isSigned;
72        _verifyDigest = verifyDigest;
73        _applicationDomainTarget = applicationDomainTarget;
74        _moduleFactory = moduleFactory;
75
76    }
77
78    //--------------------------------------------------------------------------
79    //
80    //  Properties
81    //
82    //--------------------------------------------------------------------------
83
84    //----------------------------------
85    //  applicationDomainTarget
86    //----------------------------------
87
88    /**
89     *  @private
90     */
91    private var _applicationDomainTarget:String;
92
93    /**
94     *  The requested application domain to load the RSL into.
95     *  For valid values see the ApplicationDomainTarget enumeration.
96     *
97     *  @see mx.core.ApplicationDomainTarget
98     *
99     *  @langversion 3.0
100     *  @playerversion Flash 10.2
101     *  @playerversion AIR 2.5
102     *  @productversion Flex 4.5
103     */
104    public function get applicationDomainTarget():String
105    {
106        return _applicationDomainTarget;
107    }
108
109    //----------------------------------
110    //  digest
111    //----------------------------------
112
113    /**
114     *  @private
115     */
116    private var _digest:String;
117
118    /**
119     *  The digest of the RSL. This is null for an RSL without a digest.
120     *
121     *  @langversion 3.0
122     *  @playerversion Flash 10.2
123     *  @playerversion AIR 2.5
124     *  @productversion Flex 4.5
125     */
126    public function get digest():String
127    {
128        return _digest;
129    }
130
131    //----------------------------------
132    //  hash type
133    //----------------------------------
134
135    /**
136     *  @private
137     */
138    private var _hashType:String;
139
140    /**
141     *  The type of hash used to create the RSL digest. The only supported hash
142     *  type is <code>SHA256.TYPE_ID</code>.
143     *
144     *  @langversion 3.0
145     *  @playerversion Flash 10.2
146     *  @playerversion AIR 2.5
147     *  @productversion Flex 4.5
148     */
149    public function get hashType():String
150    {
151        return _hashType;
152    }
153
154    //----------------------------------
155    //  isSigned
156    //----------------------------------
157
158    /**
159     *  @private
160     */
161    private var _isSigned:Boolean;
162
163    /**
164     *  True if the RSL has been signed by Adobe. False otherwise.
165     *
166     *  @langversion 3.0
167     *  @playerversion Flash 10.2
168     *  @playerversion AIR 2.5
169     *  @productversion Flex 4.5
170     */
171    public function get isSigned():Boolean
172    {
173        return _isSigned;
174    }
175
176    //----------------------------------
177    //  moduleFactory
178    //----------------------------------
179
180    /**
181     *  @private
182     */
183    private var _moduleFactory:IFlexModuleFactory;
184
185    /**
186     *  Non-null if this RSL should be loaded into an application
187     *  domain other than the application domain associated with the
188     *  module factory performing the load. If null, then load into
189     *  the current application domain.
190     *
191     *  @langversion 3.0
192     *  @playerversion Flash 10.2
193     *  @playerversion AIR 2.5
194     *  @productversion Flex 4.5
195     */
196    public function get moduleFactory():IFlexModuleFactory
197    {
198        return _moduleFactory;
199    }
200
201    /**
202     *  @private
203     */
204    public function set moduleFactory(moduleFactory:IFlexModuleFactory):void
205    {
206        _moduleFactory = moduleFactory;
207    }
208
209   //----------------------------------
210    //  policyFileURL
211    //----------------------------------
212
213    /**
214     *  @private
215     */
216    private var _policyFileURL:String;
217
218    /**
219     *  An URL that specifies the location of the policy file (optional).
220     *
221     *  @langversion 3.0
222     *  @playerversion Flash 10.2
223     *  @playerversion AIR 2.5
224     *  @productversion Flex 4.5
225     */
226    public function get policyFileURL():String
227    {
228        return _policyFileURL;
229    }
230
231    //----------------------------------
232    //  rslURL
233    //----------------------------------
234
235    /**
236     *  @private
237     */
238    private var _rslURL:String;
239
240    /**
241     *  The location of the RSL. The URL can be absolute or relative to the
242     *  application or module.
243     *
244     *  @langversion 3.0
245     *  @playerversion Flash 10.2
246     *  @playerversion AIR 2.5
247     *  @productversion Flex 4.5
248     */
249    public function get rslURL():String
250    {
251        return _rslURL;
252    }
253
254    //----------------------------------
255    //  verifyDigest
256    //----------------------------------
257
258    /**
259     *  @private
260     */
261    private var _verifyDigest:Boolean;
262
263    /**
264     *  True if the digest must be verified before loading the RSL into memory.
265     *  False allows the RSL to be loaded without verification. Signed RSLs
266     *  are always verified regardless of the value.
267     *
268     *  @langversion 3.0
269     *  @playerversion Flash 10.2
270     *  @playerversion AIR 2.5
271     *  @productversion Flex 4.5
272     */
273    public function get verifyDigest():Boolean
274    {
275        return _verifyDigest;
276    }
277
278}
279}