dango_generator 0.0.38
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +16 -0
- data/README.txt +41 -0
- data/dango_generator.rb +99 -0
- data/templates/as3/as3corelib-license.txt +33 -0
- data/templates/as3/as3corelib-readme.txt +5 -0
- data/templates/as3/com/adobe/crypto/MD5.as +256 -0
- data/templates/as3/com/adobe/crypto/SHA1.as +268 -0
- data/templates/as3/com/adobe/crypto/SHA224.as +255 -0
- data/templates/as3/com/adobe/crypto/SHA256.as +260 -0
- data/templates/as3/com/adobe/crypto/WSSEUsernameToken.as +117 -0
- data/templates/as3/com/adobe/errors/IllegalStateError.as +66 -0
- data/templates/as3/com/adobe/images/BitString.as +42 -0
- data/templates/as3/com/adobe/images/JPGEncoder.as +651 -0
- data/templates/as3/com/adobe/images/PNGEncoder.as +144 -0
- data/templates/as3/com/adobe/net/DynamicURLLoader.as +58 -0
- data/templates/as3/com/adobe/net/IURIResolver.as +79 -0
- data/templates/as3/com/adobe/net/URI.as +2469 -0
- data/templates/as3/com/adobe/net/URIEncodingBitmap.as +142 -0
- data/templates/as3/com/adobe/net/proxies/RFC2817Socket.as +204 -0
- data/templates/as3/com/adobe/serialization/json/JSON.as +88 -0
- data/templates/as3/com/adobe/serialization/json/JSONDecoder.as +218 -0
- data/templates/as3/com/adobe/serialization/json/JSONEncoder.as +302 -0
- data/templates/as3/com/adobe/serialization/json/JSONParseError.as +90 -0
- data/templates/as3/com/adobe/serialization/json/JSONToken.as +107 -0
- data/templates/as3/com/adobe/serialization/json/JSONTokenType.as +70 -0
- data/templates/as3/com/adobe/serialization/json/JSONTokenizer.as +550 -0
- data/templates/as3/com/adobe/utils/ArrayUtil.as +190 -0
- data/templates/as3/com/adobe/utils/DateUtil.as +666 -0
- data/templates/as3/com/adobe/utils/DictionaryUtil.as +90 -0
- data/templates/as3/com/adobe/utils/IntUtil.as +69 -0
- data/templates/as3/com/adobe/utils/NumberFormatter.as +77 -0
- data/templates/as3/com/adobe/utils/StringUtil.as +257 -0
- data/templates/as3/com/adobe/utils/XMLUtil.as +171 -0
- data/templates/as3/com/adobe/webapis/ServiceBase.as +51 -0
- data/templates/as3/com/adobe/webapis/URLLoaderBase.as +111 -0
- data/templates/as3/com/adobe/webapis/events/ServiceEvent.as +78 -0
- data/templates/as3/org/rubyforge/dango/DangoClientFramework.as +426 -0
- data/templates/as3/org/rubyforge/dango/DangoError.as +11 -0
- data/templates/as3/org/rubyforge/dango/DangoErrorCode.as +7 -0
- data/templates/as3/org/rubyforge/dango/DangoErrorEvent.as +23 -0
- data/templates/as3/org/rubyforge/dango/DangoReceiveEvent.as +21 -0
- data/templates/as3/org/rubyforge/dango/DangoURLLoader.as +127 -0
- data/templates/as3/org/rubyforge/dango/DangoURLLoaderEvent.as +29 -0
- data/templates/as3/org/rubyforge/dango/DangoUtil.as +84 -0
- data/templates/dango/config/development.yml +28 -0
- data/templates/dango/config/production.yml +3 -0
- data/templates/dango/config/system_message.yml +5 -0
- data/templates/dango/config/test.yml +3 -0
- data/templates/dango/server/99_dango_server.rb +22 -0
- data/templates/lib/dango_monitor_client.rb +1 -0
- data/templates/lib/dango_tester_client.rb +1 -0
- data/templates/script/dango_server +36 -0
- data/templates/tasks/dango.rake +2 -0
- metadata +108 -0
@@ -0,0 +1,260 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
package com.adobe.crypto
|
37
|
+
{
|
38
|
+
import com.adobe.utils.IntUtil;
|
39
|
+
import flash.utils.ByteArray;
|
40
|
+
import mx.utils.Base64Encoder;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* The SHA-256 algorithm
|
44
|
+
*
|
45
|
+
* @see http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf
|
46
|
+
*/
|
47
|
+
public class SHA256
|
48
|
+
{
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Performs the SHA256 hash algorithm on a string.
|
52
|
+
*
|
53
|
+
* @param s The string to hash
|
54
|
+
* @return A string containing the hash value of s
|
55
|
+
* @langversion ActionScript 3.0
|
56
|
+
* @playerversion 9.0
|
57
|
+
* @tiptext
|
58
|
+
*/
|
59
|
+
public static function hash( s:String ):String {
|
60
|
+
var blocks:Array = createBlocksFromString( s );
|
61
|
+
var byteArray:ByteArray = hashBlocks( blocks );
|
62
|
+
|
63
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
64
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
65
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
66
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
67
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
68
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
69
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
70
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Performs the SHA256 hash algorithm on a ByteArray.
|
75
|
+
*
|
76
|
+
* @param data The ByteArray data to hash
|
77
|
+
* @return A string containing the hash value of data
|
78
|
+
* @langversion ActionScript 3.0
|
79
|
+
* @playerversion 9.0
|
80
|
+
*/
|
81
|
+
public static function hashBytes( data:ByteArray ):String
|
82
|
+
{
|
83
|
+
var blocks:Array = createBlocksFromByteArray( data );
|
84
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
85
|
+
|
86
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
87
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
88
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
89
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
90
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
91
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
92
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
93
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
94
|
+
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Performs the SHA256 hash algorithm on a string, then does
|
98
|
+
* Base64 encoding on the result.
|
99
|
+
*
|
100
|
+
* @param s The string to hash
|
101
|
+
* @return The base64 encoded hash value of s
|
102
|
+
* @langversion ActionScript 3.0
|
103
|
+
* @playerversion 9.0
|
104
|
+
* @tiptext
|
105
|
+
*/
|
106
|
+
public static function hashToBase64( s:String ):String
|
107
|
+
{
|
108
|
+
var blocks:Array = createBlocksFromString( s );
|
109
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
110
|
+
|
111
|
+
// ByteArray.toString() returns the contents as a UTF-8 string,
|
112
|
+
// which we can't use because certain byte sequences might trigger
|
113
|
+
// a UTF-8 conversion. Instead, we convert the bytes to characters
|
114
|
+
// one by one.
|
115
|
+
var charsInByteArray:String = "";
|
116
|
+
byteArray.position = 0;
|
117
|
+
for (var j:int = 0; j < byteArray.length; j++)
|
118
|
+
{
|
119
|
+
var byte:uint = byteArray.readUnsignedByte();
|
120
|
+
charsInByteArray += String.fromCharCode(byte);
|
121
|
+
}
|
122
|
+
|
123
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
124
|
+
encoder.encode(charsInByteArray);
|
125
|
+
return encoder.flush();
|
126
|
+
}
|
127
|
+
|
128
|
+
private static function hashBlocks( blocks:Array ):ByteArray {
|
129
|
+
var h0:int = 0x6a09e667;
|
130
|
+
var h1:int = 0xbb67ae85;
|
131
|
+
var h2:int = 0x3c6ef372;
|
132
|
+
var h3:int = 0xa54ff53a;
|
133
|
+
var h4:int = 0x510e527f;
|
134
|
+
var h5:int = 0x9b05688c;
|
135
|
+
var h6:int = 0x1f83d9ab;
|
136
|
+
var h7:int = 0x5be0cd19;
|
137
|
+
|
138
|
+
var k:Array = new Array(0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2);
|
139
|
+
|
140
|
+
var len:int = blocks.length;
|
141
|
+
var w:Array = new Array( 64 );
|
142
|
+
|
143
|
+
// loop over all of the blocks
|
144
|
+
for ( var i:int = 0; i < len; i += 16 ) {
|
145
|
+
|
146
|
+
var a:int = h0;
|
147
|
+
var b:int = h1;
|
148
|
+
var c:int = h2;
|
149
|
+
var d:int = h3;
|
150
|
+
var e:int = h4;
|
151
|
+
var f:int = h5;
|
152
|
+
var g:int = h6;
|
153
|
+
var h:int = h7;
|
154
|
+
|
155
|
+
for(var t:int = 0; t < 64; t++) {
|
156
|
+
|
157
|
+
if ( t < 16 ) {
|
158
|
+
w[t] = blocks[ i + t ];
|
159
|
+
if(isNaN(w[t])) { w[t] = 0; }
|
160
|
+
} else {
|
161
|
+
var ws0:int = IntUtil.ror(w[t-15], 7) ^ IntUtil.ror(w[t-15], 18) ^ (w[t-15] >>> 3);
|
162
|
+
var ws1:int = IntUtil.ror(w[t-2], 17) ^ IntUtil.ror(w[t-2], 19) ^ (w[t-2] >>> 10);
|
163
|
+
w[t] = w[t-16] + ws0 + w[t-7] + ws1;
|
164
|
+
}
|
165
|
+
|
166
|
+
var s0:int = IntUtil.ror(a, 2) ^ IntUtil.ror(a, 13) ^ IntUtil.ror(a, 22);
|
167
|
+
var maj:int = (a & b) ^ (a & c) ^ (b & c);
|
168
|
+
var t2:int = s0 + maj;
|
169
|
+
var s1:int = IntUtil.ror(e, 6) ^ IntUtil.ror(e, 11) ^ IntUtil.ror(e, 25);
|
170
|
+
var ch:int = (e & f) ^ ((~e) & g);
|
171
|
+
var t1:int = h + s1 + ch + k[t] + w[t];
|
172
|
+
|
173
|
+
h = g;
|
174
|
+
g = f;
|
175
|
+
f = e;
|
176
|
+
e = d + t1;
|
177
|
+
d = c;
|
178
|
+
c = b;
|
179
|
+
b = a;
|
180
|
+
a = t1 + t2;
|
181
|
+
}
|
182
|
+
|
183
|
+
//Add this chunk's hash to result so far:
|
184
|
+
h0 += a;
|
185
|
+
h1 += b;
|
186
|
+
h2 += c;
|
187
|
+
h3 += d;
|
188
|
+
h4 += e;
|
189
|
+
h5 += f;
|
190
|
+
h6 += g;
|
191
|
+
h7 += h;
|
192
|
+
}
|
193
|
+
|
194
|
+
var byteArray:ByteArray = new ByteArray();
|
195
|
+
byteArray.writeInt(h0);
|
196
|
+
byteArray.writeInt(h1);
|
197
|
+
byteArray.writeInt(h2);
|
198
|
+
byteArray.writeInt(h3);
|
199
|
+
byteArray.writeInt(h4);
|
200
|
+
byteArray.writeInt(h5);
|
201
|
+
byteArray.writeInt(h6);
|
202
|
+
byteArray.writeInt(h7);
|
203
|
+
byteArray.position = 0;
|
204
|
+
return byteArray;
|
205
|
+
}
|
206
|
+
|
207
|
+
/**
|
208
|
+
* Converts a ByteArray to a sequence of 16-word blocks
|
209
|
+
* that we'll do the processing on. Appends padding
|
210
|
+
* and length in the process.
|
211
|
+
*
|
212
|
+
* @param data The data to split into blocks
|
213
|
+
* @return An array containing the blocks into which data was split
|
214
|
+
*/
|
215
|
+
private static function createBlocksFromByteArray( data:ByteArray ):Array
|
216
|
+
{
|
217
|
+
var oldPosition:int = data.position;
|
218
|
+
data.position = 0;
|
219
|
+
|
220
|
+
var blocks:Array = new Array();
|
221
|
+
var len:int = data.length * 8;
|
222
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
223
|
+
for( var i:int = 0; i < len; i += 8 )
|
224
|
+
{
|
225
|
+
blocks[ i >> 5 ] |= ( data.readByte() & mask ) << ( 24 - i % 32 );
|
226
|
+
}
|
227
|
+
|
228
|
+
// append padding and length
|
229
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
230
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
231
|
+
|
232
|
+
data.position = oldPosition;
|
233
|
+
|
234
|
+
return blocks;
|
235
|
+
}
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Converts a string to a sequence of 16-word blocks
|
239
|
+
* that we'll do the processing on. Appends padding
|
240
|
+
* and length in the process.
|
241
|
+
*
|
242
|
+
* @param s The string to split into blocks
|
243
|
+
* @return An array containing the blocks that s was split into.
|
244
|
+
*/
|
245
|
+
private static function createBlocksFromString( s:String ):Array
|
246
|
+
{
|
247
|
+
var blocks:Array = new Array();
|
248
|
+
var len:int = s.length * 8;
|
249
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
250
|
+
for( var i:int = 0; i < len; i += 8 ) {
|
251
|
+
blocks[ i >> 5 ] |= ( s.charCodeAt( i / 8 ) & mask ) << ( 24 - i % 32 );
|
252
|
+
}
|
253
|
+
|
254
|
+
// append padding and length
|
255
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
256
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
257
|
+
return blocks;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
package com.adobe.crypto
|
37
|
+
{
|
38
|
+
import mx.formatters.DateFormatter;
|
39
|
+
import mx.utils.Base64Encoder;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Web Services Security Username Token
|
43
|
+
*
|
44
|
+
* Implementation based on algorithm description at
|
45
|
+
* http://www.oasis-open.org/committees/wss/documents/WSS-Username-02-0223-merged.pdf
|
46
|
+
*/
|
47
|
+
public class WSSEUsernameToken
|
48
|
+
{
|
49
|
+
/**
|
50
|
+
* Generates a WSSE Username Token.
|
51
|
+
*
|
52
|
+
* @param username The username
|
53
|
+
* @param password The password
|
54
|
+
* @param nonce A cryptographically random nonce (if null, the nonce
|
55
|
+
* will be generated)
|
56
|
+
* @param timestamp The time at which the token is generated (if null,
|
57
|
+
* the time will be set to the moment of execution)
|
58
|
+
* @return The generated token
|
59
|
+
* @langversion ActionScript 3.0
|
60
|
+
* @playerversion Flash 9.0
|
61
|
+
* @tiptext
|
62
|
+
*/
|
63
|
+
public static function getUsernameToken(username:String, password:String, nonce:String=null, timestamp:Date=null):String
|
64
|
+
{
|
65
|
+
if (nonce == null)
|
66
|
+
{
|
67
|
+
nonce = generateNonce();
|
68
|
+
}
|
69
|
+
nonce = base64Encode(nonce);
|
70
|
+
|
71
|
+
var created:String = generateTimestamp(timestamp);
|
72
|
+
|
73
|
+
var password64:String = getBase64Digest(nonce,
|
74
|
+
created,
|
75
|
+
password);
|
76
|
+
|
77
|
+
var token:String = new String("UsernameToken Username=\"");
|
78
|
+
token += username + "\", " +
|
79
|
+
"PasswordDigest=\"" + password64 + "\", " +
|
80
|
+
"Nonce=\"" + nonce + "\", " +
|
81
|
+
"Created=\"" + created + "\"";
|
82
|
+
return token;
|
83
|
+
}
|
84
|
+
|
85
|
+
private static function generateNonce():String
|
86
|
+
{
|
87
|
+
// Math.random returns a Number between 0 and 1. We don't want our
|
88
|
+
// nonce to contain invalid characters (e.g. the period) so we
|
89
|
+
// strip them out before returning the result.
|
90
|
+
var s:String = Math.random().toString();
|
91
|
+
return s.replace(".", "");
|
92
|
+
}
|
93
|
+
|
94
|
+
internal static function base64Encode(s:String):String
|
95
|
+
{
|
96
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
97
|
+
encoder.encode(s);
|
98
|
+
return encoder.flush();
|
99
|
+
}
|
100
|
+
|
101
|
+
internal static function generateTimestamp(timestamp:Date):String
|
102
|
+
{
|
103
|
+
if (timestamp == null)
|
104
|
+
{
|
105
|
+
timestamp = new Date();
|
106
|
+
}
|
107
|
+
var dateFormatter:DateFormatter = new DateFormatter();
|
108
|
+
dateFormatter.formatString = "YYYY-MM-DDTJJ:NN:SS"
|
109
|
+
return dateFormatter.format(timestamp) + "Z";
|
110
|
+
}
|
111
|
+
|
112
|
+
internal static function getBase64Digest(nonce:String, created:String, password:String):String
|
113
|
+
{
|
114
|
+
return SHA1.hashToBase64(nonce + created + password);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
|
36
|
+
package com.adobe.errors
|
37
|
+
{
|
38
|
+
/**
|
39
|
+
* This class represents an Error that is thrown when a method is called when
|
40
|
+
* the receiving instance is in an invalid state.
|
41
|
+
*
|
42
|
+
* For example, this may occur if a method has been called, and other properties
|
43
|
+
* in the instance have not been initialized properly.
|
44
|
+
*
|
45
|
+
* @langversion ActionScript 3.0
|
46
|
+
* @playerversion Flash 9.0
|
47
|
+
* @tiptext
|
48
|
+
*
|
49
|
+
*/
|
50
|
+
public class IllegalStateError extends Error
|
51
|
+
{
|
52
|
+
/**
|
53
|
+
* Constructor
|
54
|
+
*
|
55
|
+
* @param message A message describing the error in detail.
|
56
|
+
*
|
57
|
+
* @langversion ActionScript 3.0
|
58
|
+
* @playerversion Flash 9.0
|
59
|
+
* @tiptext
|
60
|
+
*/
|
61
|
+
public function IllegalStateError(message:String)
|
62
|
+
{
|
63
|
+
super(message);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*
|
2
|
+
Adobe Systems Incorporated(r) Source Code License Agreement
|
3
|
+
Copyright(c) 2005 Adobe Systems Incorporated. All rights reserved.
|
4
|
+
|
5
|
+
Please read this Source Code License Agreement carefully before using
|
6
|
+
the source code.
|
7
|
+
|
8
|
+
Adobe Systems Incorporated grants to you a perpetual, worldwide, non-exclusive,
|
9
|
+
no-charge, royalty-free, irrevocable copyright license, to reproduce,
|
10
|
+
prepare derivative works of, publicly display, publicly perform, and
|
11
|
+
distribute this source code and such derivative works in source or
|
12
|
+
object code form without any attribution requirements.
|
13
|
+
|
14
|
+
The name "Adobe Systems Incorporated" must not be used to endorse or promote products
|
15
|
+
derived from the source code without prior written permission.
|
16
|
+
|
17
|
+
You agree to indemnify, hold harmless and defend Adobe Systems Incorporated from and
|
18
|
+
against any loss, damage, claims or lawsuits, including attorney's
|
19
|
+
fees that arise or result from your use or distribution of the source
|
20
|
+
code.
|
21
|
+
|
22
|
+
THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT
|
23
|
+
ANY TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
|
24
|
+
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
25
|
+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF
|
26
|
+
NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA
|
27
|
+
OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
28
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
29
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
30
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
31
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE CODE, EVEN IF
|
33
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
*/
|
35
|
+
package com.adobe.images
|
36
|
+
{
|
37
|
+
public class BitString
|
38
|
+
{
|
39
|
+
public var len:int = 0;
|
40
|
+
public var val:int = 0;
|
41
|
+
}
|
42
|
+
}
|