mako 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/mako +133 -0
- data/lib/mako/build.rb +336 -0
- data/lib/mako/data/flash_widget_dev_core/Dependencies.txt +10 -0
- data/lib/mako/data/flash_widget_dev_core/libs/Degrafa_.2.11.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoGraphics.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoSymbols.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/flash.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/ARLRDBD.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/FTD_____.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdana.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanab.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanai.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanaz.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc2.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc3.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/qa.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/so.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/kogLogo.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/creatorStyle.css +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/style.css +929 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/LICENSE.txt +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/CubeRotate.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Distortion.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/DistortionConstants.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Door.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Flip.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Gate.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Pop.as +53 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Push.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/SimpleDistortion.as +619 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/CubeRotateInstance.as +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DistortBaseInstance.as +258 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DoorInstance.as +116 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/FlipInstance.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/GateInstance.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PopInstance.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PushInstance.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBounds.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBoundsUtil.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/SimpleDisplayObjectBoundsUtil.as +60 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/HMAC.as +108 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5Stream.as +343 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA1.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA224.as +226 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA256.as +229 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/WSSEUsernameToken.as +100 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFade.as +107 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadeInstance.as +178 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadePopUpBlocker.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/errors/IllegalStateError.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Address.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Email.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Phone.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCard.as +47 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCardParser.as +234 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/BitString.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/JPGEncoder.as +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/PNGEncoder.as +133 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/DynamicURLLoader.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/IURIResolver.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/MimeTypeMap.as +192 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URI.as +2139 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URIEncodingBitmap.as +122 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/proxies/RFC2817Socket.as +179 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Database.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Definition.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Dict.as +322 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/DictionaryServer.as +50 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/MatchStrategy.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Response.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ConnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DatabaseEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ErrorEvent.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/NoMatchEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/SocketHelper.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSON.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONDecoder.as +303 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONEncoder.as +277 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONParseError.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONToken.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenType.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenizer.as +605 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/ArrayUtil.as +166 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DateUtil.as +657 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DictionaryUtil.as +73 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/IntUtil.as +85 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/NumberFormatter.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/StringUtil.as +220 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/XMLUtil.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/ServiceBase.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/URLLoaderBase.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/events/ServiceEvent.as +67 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/geom/ColorMatrix.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTween.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweenTimeline.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweener.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Back.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Bounce.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Circular.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Cubic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Elastic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Exponential.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Linear.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quadratic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quartic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quintic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Sine.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/AutoHidePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/BlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorAdjustPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/CurrentFramePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/IGTweenPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MatrixPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MotionBlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SmartRotationPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SnappingPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SoundTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/utils/SWFBridgeAS3.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/GUID.as +82 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/MathExt.as +114 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/OverwriteManager.as +143 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenFilterLite.as +502 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenLite.as +512 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenMax.as +987 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Back.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Bounce.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Circ.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Cubic.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Elastic.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Expo.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Linear.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quad.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quart.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quint.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Sine.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Strong.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/easing_readme.txt +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/events/TweenEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BevelFilterVars.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BlurFilterVars.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/ColorMatrixFilterVars.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/DropShadowFilterVars.as +66 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/GlowFilterVars.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenFilterLiteVars.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenLiteVars.as +269 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenMaxVars.as +103 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenEvent.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenObject.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenSingleton.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Constant.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlow.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlowFast.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Shake.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFast.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFastSlow.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ImageUtils.as +173 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ResizeStyle.as +52 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorBase.mxml +504 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorConfig.as +45 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorEvents.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/Dialog.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/MateriaButton.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/PopUpAlert.mxml +271 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/GradientBackground.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/PercentField.mxml +104 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/ScrollableSizableImage.mxml +654 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextAreaWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextInputWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/VertCenterTextRenderer.mxml +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/ImportEvent.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/itemRenderers/CheckBoxColumn.mxml +23 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDetails.mxml +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDisplay.mxml +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGrid.mxml +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGridEvent.as +20 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerColumn.as +13 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerDataGrid.mxml +692 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputItem.mxml +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputObject.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpBubble.mxml +245 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpDot.mxml +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpManager.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpObject.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/IHelpGuided.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/ImageCacherImage.mxml +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/MateriaUploader.as +61 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/Question.as +386 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionGroup.as +313 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionSet.as +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/CommonUtils.as +186 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/DateUtils.as +273 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/ImageCacher.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/Randomize.as +19 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/SimpleClone.as +32 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Color.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Draw.as +65 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dashed.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dotted.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Check.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Rect.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBevel.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBorder.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRound.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRoundBorder.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/TriangleEquilateral.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/X.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/ScoringError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/StorageError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/ButtonEvent.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/PayloadEvent.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/StandardEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/Question.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionGroup.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionSet.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/WidgetSettings.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerEvents.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerMessageEvent.as +31 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/logging/Log.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/scoring/Scoring.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageManager.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageTable.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/engines/EngineCore.as +222 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/geom/Dimension.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/Respondus.as +612 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusAnswer.as +11 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusError.as +18 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuestion.as +43 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuiz.as +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/AlertWindow.as +182 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/BlueButton.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button_base.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Component.as +98 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ContentBlocker.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FlexUIScaler.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FormInput.as +191 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/GrabZoomClip.as +305 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/HelpLayer.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Label.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List_Base.as +644 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProcessingBar.as +112 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar_base.as +69 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar_base.as +378 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollClip.as +468 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText_base.as +295 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/SimpleScrollBar.as +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StageRef.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTank.as +233 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTankHorizontal.as +109 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ToolTip.as +930 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/TweeningDragDropBankList.as +503 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window.as +144 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window_base.as +385 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/CenterScale.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowManager.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowStage.as +96 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/BitField.as +99 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/ObjPeek.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Objects.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Printer.as +548 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/StringUtil.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/FaultEvent.as +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingCall.as +211 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingConnection.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingService.as +214 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/ResultEvent.as +36 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/DistortImage.as +281 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/SandyPoint.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/Triangle.as +32 -0
- data/lib/mako/data/html/thistest.html +0 -0
- data/lib/mako/data/template_creator/src/Creator.mxml +138 -0
- data/lib/mako/data/template_creator/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/creatorStyle.css +63 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/style.css +1127 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditor.mxml +678 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditorToolbar.mxml +133 -0
- data/lib/mako/data/templates/html/README.md +11 -0
- data/lib/mako/data/templates/html/_creator/build.yaml +12 -0
- data/lib/mako/data/templates/html/_creator/creator.html +19 -0
- data/lib/mako/data/templates/html/_creator/css/creator.less +29 -0
- data/lib/mako/data/templates/html/_creator/js/creator.coffee +122 -0
- data/lib/mako/data/templates/html/_creator/test.html +0 -0
- data/lib/mako/data/templates/html/_engine/build.yaml +12 -0
- data/lib/mako/data/templates/html/_engine/css/widget.scss +18 -0
- data/lib/mako/data/templates/html/_engine/js/widget.coffee +143 -0
- data/lib/mako/data/templates/html/_engine/widget.html +21 -0
- data/lib/mako/data/templates/html/_icons/icon-275.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-394.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-60.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-92.png +0 -0
- data/lib/mako/data/templates/html/_score/score_module.php +48 -0
- data/lib/mako/data/templates/html/_score/test_score_module.php +157 -0
- data/lib/mako/data/templates/html/_screen-shots/1-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/1.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3.png +0 -0
- data/lib/mako/data/templates/html/build.yaml +4 -0
- data/lib/mako/data/templates/html/demo.yaml +7 -0
- data/lib/mako/data/templates/html/install.yaml +94 -0
- data/lib/mako/path.rb +48 -0
- data/lib/mako/scaffold.rb +69 -0
- metadata +597 -0
@@ -0,0 +1,226 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
3
|
+
All rights reserved.
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
13
|
+
contributors may be used to endorse or promote products derived from
|
14
|
+
this software without specific prior written permission.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
16
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
17
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
package com.adobe.crypto
|
28
|
+
{
|
29
|
+
import com.adobe.utils.IntUtil;
|
30
|
+
import flash.utils.ByteArray;
|
31
|
+
import mx.utils.Base64Encoder;
|
32
|
+
/**
|
33
|
+
* The SHA-224 algorithm
|
34
|
+
*
|
35
|
+
* @see http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf
|
36
|
+
*/
|
37
|
+
public class SHA224
|
38
|
+
{
|
39
|
+
public static var digest:ByteArray;
|
40
|
+
/**
|
41
|
+
* Performs the SHA224 hash algorithm on a string.
|
42
|
+
*
|
43
|
+
* @param s The string to hash
|
44
|
+
* @return A string containing the hash value of s
|
45
|
+
* @langversion ActionScript 3.0
|
46
|
+
* @playerversion 9.0
|
47
|
+
* @tiptext
|
48
|
+
*/
|
49
|
+
public static function hash( s:String ):String {
|
50
|
+
var blocks:Array = createBlocksFromString( s );
|
51
|
+
var byteArray:ByteArray = hashBlocks( blocks );
|
52
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
53
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
54
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
55
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
56
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
57
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
58
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Performs the SHA224 hash algorithm on a ByteArray.
|
62
|
+
*
|
63
|
+
* @param data The ByteArray data to hash
|
64
|
+
* @return A string containing the hash value of data
|
65
|
+
* @langversion ActionScript 3.0
|
66
|
+
* @playerversion 9.0
|
67
|
+
*/
|
68
|
+
public static function hashBytes( data:ByteArray ):String
|
69
|
+
{
|
70
|
+
var blocks:Array = createBlocksFromByteArray( data );
|
71
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
72
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
73
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
74
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
75
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
76
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
77
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
78
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* Performs the SHA224 hash algorithm on a string, then does
|
82
|
+
* Base64 encoding on the result.
|
83
|
+
*
|
84
|
+
* @param s The string to hash
|
85
|
+
* @return The base64 encoded hash value of s
|
86
|
+
* @langversion ActionScript 3.0
|
87
|
+
* @playerversion 9.0
|
88
|
+
* @tiptext
|
89
|
+
*/
|
90
|
+
public static function hashToBase64( s:String ):String
|
91
|
+
{
|
92
|
+
var blocks:Array = createBlocksFromString( s );
|
93
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
94
|
+
// ByteArray.toString() returns the contents as a UTF-8 string,
|
95
|
+
// which we can't use because certain byte sequences might trigger
|
96
|
+
// a UTF-8 conversion. Instead, we convert the bytes to characters
|
97
|
+
// one by one.
|
98
|
+
var charsInByteArray:String = "";
|
99
|
+
byteArray.position = 0;
|
100
|
+
for (var j:int = 0; j < byteArray.length; j++)
|
101
|
+
{
|
102
|
+
var byte:uint = byteArray.readUnsignedByte();
|
103
|
+
charsInByteArray += String.fromCharCode(byte);
|
104
|
+
}
|
105
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
106
|
+
encoder.encode(charsInByteArray);
|
107
|
+
return encoder.flush();
|
108
|
+
}
|
109
|
+
private static function hashBlocks( blocks:Array ):ByteArray {
|
110
|
+
var h0:int = 0xc1059ed8;
|
111
|
+
var h1:int = 0x367cd507;
|
112
|
+
var h2:int = 0x3070dd17;
|
113
|
+
var h3:int = 0xf70e5939;
|
114
|
+
var h4:int = 0xffc00b31;
|
115
|
+
var h5:int = 0x68581511;
|
116
|
+
var h6:int = 0x64f98fa7;
|
117
|
+
var h7:int = 0xbefa4fa4;
|
118
|
+
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);
|
119
|
+
var len:int = blocks.length;
|
120
|
+
var w:Array = new Array();
|
121
|
+
// loop over all of the blocks
|
122
|
+
for ( var i:int = 0; i < len; i += 16 ) {
|
123
|
+
var a:int = h0;
|
124
|
+
var b:int = h1;
|
125
|
+
var c:int = h2;
|
126
|
+
var d:int = h3;
|
127
|
+
var e:int = h4;
|
128
|
+
var f:int = h5;
|
129
|
+
var g:int = h6;
|
130
|
+
var h:int = h7;
|
131
|
+
for(var t:int = 0; t < 64; t++) {
|
132
|
+
if ( t < 16 ) {
|
133
|
+
w[t] = blocks[ i + t ];
|
134
|
+
if(isNaN(w[t])) { w[t] = 0; }
|
135
|
+
} else {
|
136
|
+
var ws0:int = IntUtil.ror(w[t-15], 7) ^ IntUtil.ror(w[t-15], 18) ^ (w[t-15] >>> 3);
|
137
|
+
var ws1:int = IntUtil.ror(w[t-2], 17) ^ IntUtil.ror(w[t-2], 19) ^ (w[t-2] >>> 10);
|
138
|
+
w[t] = w[t-16] + ws0 + w[t-7] + ws1;
|
139
|
+
}
|
140
|
+
var s0:int = IntUtil.ror(a, 2) ^ IntUtil.ror(a, 13) ^ IntUtil.ror(a, 22);
|
141
|
+
var maj:int = (a & b) ^ (a & c) ^ (b & c);
|
142
|
+
var t2:int = s0 + maj;
|
143
|
+
var s1:int = IntUtil.ror(e, 6) ^ IntUtil.ror(e, 11) ^ IntUtil.ror(e, 25);
|
144
|
+
var ch:int = (e & f) ^ ((~e) & g);
|
145
|
+
var t1:int = h + s1 + ch + k[t] + w[t];
|
146
|
+
h = g;
|
147
|
+
g = f;
|
148
|
+
f = e;
|
149
|
+
e = d + t1;
|
150
|
+
d = c;
|
151
|
+
c = b;
|
152
|
+
b = a;
|
153
|
+
a = t1 + t2;
|
154
|
+
}
|
155
|
+
//Add this chunk's hash to result so far:
|
156
|
+
h0 += a;
|
157
|
+
h1 += b;
|
158
|
+
h2 += c;
|
159
|
+
h3 += d;
|
160
|
+
h4 += e;
|
161
|
+
h5 += f;
|
162
|
+
h6 += g;
|
163
|
+
h7 += h;
|
164
|
+
}
|
165
|
+
var byteArray:ByteArray = new ByteArray();
|
166
|
+
byteArray.writeInt(h0);
|
167
|
+
byteArray.writeInt(h1);
|
168
|
+
byteArray.writeInt(h2);
|
169
|
+
byteArray.writeInt(h3);
|
170
|
+
byteArray.writeInt(h4);
|
171
|
+
byteArray.writeInt(h5);
|
172
|
+
byteArray.writeInt(h6);
|
173
|
+
byteArray.position = 0;
|
174
|
+
digest = new ByteArray();
|
175
|
+
digest.writeBytes(byteArray);
|
176
|
+
digest.position = 0;
|
177
|
+
return byteArray;
|
178
|
+
}
|
179
|
+
/**
|
180
|
+
* Converts a ByteArray to a sequence of 16-word blocks
|
181
|
+
* that we'll do the processing on. Appends padding
|
182
|
+
* and length in the process.
|
183
|
+
*
|
184
|
+
* @param data The data to split into blocks
|
185
|
+
* @return An array containing the blocks into which data was split
|
186
|
+
*/
|
187
|
+
private static function createBlocksFromByteArray( data:ByteArray ):Array
|
188
|
+
{
|
189
|
+
var oldPosition:int = data.position;
|
190
|
+
data.position = 0;
|
191
|
+
var blocks:Array = new Array();
|
192
|
+
var len:int = data.length * 8;
|
193
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
194
|
+
for( var i:int = 0; i < len; i += 8 )
|
195
|
+
{
|
196
|
+
blocks[ i >> 5 ] |= ( data.readByte() & mask ) << ( 24 - i % 32 );
|
197
|
+
}
|
198
|
+
// append padding and length
|
199
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
200
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
201
|
+
data.position = oldPosition;
|
202
|
+
return blocks;
|
203
|
+
}
|
204
|
+
/**
|
205
|
+
* Converts a string to a sequence of 16-word blocks
|
206
|
+
* that we'll do the processing on. Appends padding
|
207
|
+
* and length in the process.
|
208
|
+
*
|
209
|
+
* @param s The string to split into blocks
|
210
|
+
* @return An array containing the blocks that s was split into.
|
211
|
+
*/
|
212
|
+
private static function createBlocksFromString( s:String ):Array
|
213
|
+
{
|
214
|
+
var blocks:Array = new Array();
|
215
|
+
var len:int = s.length * 8;
|
216
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
217
|
+
for( var i:int = 0; i < len; i += 8 ) {
|
218
|
+
blocks[ i >> 5 ] |= ( s.charCodeAt( i / 8 ) & mask ) << ( 24 - i % 32 );
|
219
|
+
}
|
220
|
+
// append padding and length
|
221
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
222
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
223
|
+
return blocks;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
}
|
@@ -0,0 +1,229 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
3
|
+
All rights reserved.
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
13
|
+
contributors may be used to endorse or promote products derived from
|
14
|
+
this software without specific prior written permission.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
16
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
17
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
package com.adobe.crypto
|
28
|
+
{
|
29
|
+
import com.adobe.utils.IntUtil;
|
30
|
+
import flash.utils.ByteArray;
|
31
|
+
import mx.utils.Base64Encoder;
|
32
|
+
/**
|
33
|
+
* The SHA-256 algorithm
|
34
|
+
*
|
35
|
+
* @see http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf
|
36
|
+
*/
|
37
|
+
public class SHA256
|
38
|
+
{
|
39
|
+
public static var digest:ByteArray;
|
40
|
+
/**
|
41
|
+
* Performs the SHA256 hash algorithm on a string.
|
42
|
+
*
|
43
|
+
* @param s The string to hash
|
44
|
+
* @return A string containing the hash value of s
|
45
|
+
* @langversion ActionScript 3.0
|
46
|
+
* @playerversion 9.0
|
47
|
+
* @tiptext
|
48
|
+
*/
|
49
|
+
public static function hash( s:String ):String {
|
50
|
+
var blocks:Array = createBlocksFromString( s );
|
51
|
+
var byteArray:ByteArray = hashBlocks( blocks );
|
52
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
53
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
54
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
55
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
56
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
57
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
58
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
59
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Performs the SHA256 hash algorithm on a ByteArray.
|
63
|
+
*
|
64
|
+
* @param data The ByteArray data to hash
|
65
|
+
* @return A string containing the hash value of data
|
66
|
+
* @langversion ActionScript 3.0
|
67
|
+
* @playerversion 9.0
|
68
|
+
*/
|
69
|
+
public static function hashBytes( data:ByteArray ):String
|
70
|
+
{
|
71
|
+
var blocks:Array = createBlocksFromByteArray( data );
|
72
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
73
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
74
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
75
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
76
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
77
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
78
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
79
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
80
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Performs the SHA256 hash algorithm on a string, then does
|
84
|
+
* Base64 encoding on the result.
|
85
|
+
*
|
86
|
+
* @param s The string to hash
|
87
|
+
* @return The base64 encoded hash value of s
|
88
|
+
* @langversion ActionScript 3.0
|
89
|
+
* @playerversion 9.0
|
90
|
+
* @tiptext
|
91
|
+
*/
|
92
|
+
public static function hashToBase64( s:String ):String
|
93
|
+
{
|
94
|
+
var blocks:Array = createBlocksFromString( s );
|
95
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
96
|
+
// ByteArray.toString() returns the contents as a UTF-8 string,
|
97
|
+
// which we can't use because certain byte sequences might trigger
|
98
|
+
// a UTF-8 conversion. Instead, we convert the bytes to characters
|
99
|
+
// one by one.
|
100
|
+
var charsInByteArray:String = "";
|
101
|
+
byteArray.position = 0;
|
102
|
+
for (var j:int = 0; j < byteArray.length; j++)
|
103
|
+
{
|
104
|
+
var byte:uint = byteArray.readUnsignedByte();
|
105
|
+
charsInByteArray += String.fromCharCode(byte);
|
106
|
+
}
|
107
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
108
|
+
encoder.encode(charsInByteArray);
|
109
|
+
return encoder.flush();
|
110
|
+
}
|
111
|
+
private static function hashBlocks( blocks:Array ):ByteArray {
|
112
|
+
var h0:int = 0x6a09e667;
|
113
|
+
var h1:int = 0xbb67ae85;
|
114
|
+
var h2:int = 0x3c6ef372;
|
115
|
+
var h3:int = 0xa54ff53a;
|
116
|
+
var h4:int = 0x510e527f;
|
117
|
+
var h5:int = 0x9b05688c;
|
118
|
+
var h6:int = 0x1f83d9ab;
|
119
|
+
var h7:int = 0x5be0cd19;
|
120
|
+
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);
|
121
|
+
var len:int = blocks.length;
|
122
|
+
var w:Array = new Array( 64 );
|
123
|
+
// loop over all of the blocks
|
124
|
+
for ( var i:int = 0; i < len; i += 16 ) {
|
125
|
+
var a:int = h0;
|
126
|
+
var b:int = h1;
|
127
|
+
var c:int = h2;
|
128
|
+
var d:int = h3;
|
129
|
+
var e:int = h4;
|
130
|
+
var f:int = h5;
|
131
|
+
var g:int = h6;
|
132
|
+
var h:int = h7;
|
133
|
+
for(var t:int = 0; t < 64; t++) {
|
134
|
+
if ( t < 16 ) {
|
135
|
+
w[t] = blocks[ i + t ];
|
136
|
+
if(isNaN(w[t])) { w[t] = 0; }
|
137
|
+
} else {
|
138
|
+
var ws0:int = IntUtil.ror(w[t-15], 7) ^ IntUtil.ror(w[t-15], 18) ^ (w[t-15] >>> 3);
|
139
|
+
var ws1:int = IntUtil.ror(w[t-2], 17) ^ IntUtil.ror(w[t-2], 19) ^ (w[t-2] >>> 10);
|
140
|
+
w[t] = w[t-16] + ws0 + w[t-7] + ws1;
|
141
|
+
}
|
142
|
+
var s0:int = IntUtil.ror(a, 2) ^ IntUtil.ror(a, 13) ^ IntUtil.ror(a, 22);
|
143
|
+
var maj:int = (a & b) ^ (a & c) ^ (b & c);
|
144
|
+
var t2:int = s0 + maj;
|
145
|
+
var s1:int = IntUtil.ror(e, 6) ^ IntUtil.ror(e, 11) ^ IntUtil.ror(e, 25);
|
146
|
+
var ch:int = (e & f) ^ ((~e) & g);
|
147
|
+
var t1:int = h + s1 + ch + k[t] + w[t];
|
148
|
+
h = g;
|
149
|
+
g = f;
|
150
|
+
f = e;
|
151
|
+
e = d + t1;
|
152
|
+
d = c;
|
153
|
+
c = b;
|
154
|
+
b = a;
|
155
|
+
a = t1 + t2;
|
156
|
+
}
|
157
|
+
//Add this chunk's hash to result so far:
|
158
|
+
h0 += a;
|
159
|
+
h1 += b;
|
160
|
+
h2 += c;
|
161
|
+
h3 += d;
|
162
|
+
h4 += e;
|
163
|
+
h5 += f;
|
164
|
+
h6 += g;
|
165
|
+
h7 += h;
|
166
|
+
}
|
167
|
+
var byteArray:ByteArray = new ByteArray();
|
168
|
+
byteArray.writeInt(h0);
|
169
|
+
byteArray.writeInt(h1);
|
170
|
+
byteArray.writeInt(h2);
|
171
|
+
byteArray.writeInt(h3);
|
172
|
+
byteArray.writeInt(h4);
|
173
|
+
byteArray.writeInt(h5);
|
174
|
+
byteArray.writeInt(h6);
|
175
|
+
byteArray.writeInt(h7);
|
176
|
+
byteArray.position = 0;
|
177
|
+
digest = new ByteArray();
|
178
|
+
digest.writeBytes(byteArray);
|
179
|
+
digest.position = 0;
|
180
|
+
return byteArray;
|
181
|
+
}
|
182
|
+
/**
|
183
|
+
* Converts a ByteArray to a sequence of 16-word blocks
|
184
|
+
* that we'll do the processing on. Appends padding
|
185
|
+
* and length in the process.
|
186
|
+
*
|
187
|
+
* @param data The data to split into blocks
|
188
|
+
* @return An array containing the blocks into which data was split
|
189
|
+
*/
|
190
|
+
private static function createBlocksFromByteArray( data:ByteArray ):Array
|
191
|
+
{
|
192
|
+
var oldPosition:int = data.position;
|
193
|
+
data.position = 0;
|
194
|
+
var blocks:Array = new Array();
|
195
|
+
var len:int = data.length * 8;
|
196
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
197
|
+
for( var i:int = 0; i < len; i += 8 )
|
198
|
+
{
|
199
|
+
blocks[ i >> 5 ] |= ( data.readByte() & mask ) << ( 24 - i % 32 );
|
200
|
+
}
|
201
|
+
// append padding and length
|
202
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
203
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
204
|
+
data.position = oldPosition;
|
205
|
+
return blocks;
|
206
|
+
}
|
207
|
+
/**
|
208
|
+
* Converts a string 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 s The string to split into blocks
|
213
|
+
* @return An array containing the blocks that s was split into.
|
214
|
+
*/
|
215
|
+
private static function createBlocksFromString( s:String ):Array
|
216
|
+
{
|
217
|
+
var blocks:Array = new Array();
|
218
|
+
var len:int = s.length * 8;
|
219
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
220
|
+
for( var i:int = 0; i < len; i += 8 ) {
|
221
|
+
blocks[ i >> 5 ] |= ( s.charCodeAt( i / 8 ) & mask ) << ( 24 - i % 32 );
|
222
|
+
}
|
223
|
+
// append padding and length
|
224
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
225
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
226
|
+
return blocks;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
3
|
+
All rights reserved.
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
13
|
+
contributors may be used to endorse or promote products derived from
|
14
|
+
this software without specific prior written permission.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
16
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
17
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
package com.adobe.crypto
|
28
|
+
{
|
29
|
+
import mx.formatters.DateFormatter;
|
30
|
+
import mx.utils.Base64Encoder;
|
31
|
+
/**
|
32
|
+
* Web Services Security Username Token
|
33
|
+
*
|
34
|
+
* Implementation based on algorithm description at
|
35
|
+
* http://www.oasis-open.org/committees/wss/documents/WSS-Username-02-0223-merged.pdf
|
36
|
+
*/
|
37
|
+
public class WSSEUsernameToken
|
38
|
+
{
|
39
|
+
/**
|
40
|
+
* Generates a WSSE Username Token.
|
41
|
+
*
|
42
|
+
* @param username The username
|
43
|
+
* @param password The password
|
44
|
+
* @param nonce A cryptographically random nonce (if null, the nonce
|
45
|
+
* will be generated)
|
46
|
+
* @param timestamp The time at which the token is generated (if null,
|
47
|
+
* the time will be set to the moment of execution)
|
48
|
+
* @return The generated token
|
49
|
+
* @langversion ActionScript 3.0
|
50
|
+
* @playerversion Flash 9.0
|
51
|
+
* @tiptext
|
52
|
+
*/
|
53
|
+
public static function getUsernameToken(username:String, password:String, nonce:String=null, timestamp:Date=null):String
|
54
|
+
{
|
55
|
+
if (nonce == null)
|
56
|
+
{
|
57
|
+
nonce = generateNonce();
|
58
|
+
}
|
59
|
+
nonce = base64Encode(nonce);
|
60
|
+
var created:String = generateTimestamp(timestamp);
|
61
|
+
var password64:String = getBase64Digest(nonce,
|
62
|
+
created,
|
63
|
+
password);
|
64
|
+
var token:String = new String("UsernameToken Username=\"");
|
65
|
+
token += username + "\", " +
|
66
|
+
"PasswordDigest=\"" + password64 + "\", " +
|
67
|
+
"Nonce=\"" + nonce + "\", " +
|
68
|
+
"Created=\"" + created + "\"";
|
69
|
+
return token;
|
70
|
+
}
|
71
|
+
private static function generateNonce():String
|
72
|
+
{
|
73
|
+
// Math.random returns a Number between 0 and 1. We don't want our
|
74
|
+
// nonce to contain invalid characters (e.g. the period) so we
|
75
|
+
// strip them out before returning the result.
|
76
|
+
var s:String = Math.random().toString();
|
77
|
+
return s.replace(".", "");
|
78
|
+
}
|
79
|
+
internal static function base64Encode(s:String):String
|
80
|
+
{
|
81
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
82
|
+
encoder.encode(s);
|
83
|
+
return encoder.flush();
|
84
|
+
}
|
85
|
+
internal static function generateTimestamp(timestamp:Date):String
|
86
|
+
{
|
87
|
+
if (timestamp == null)
|
88
|
+
{
|
89
|
+
timestamp = new Date();
|
90
|
+
}
|
91
|
+
var dateFormatter:DateFormatter = new DateFormatter();
|
92
|
+
dateFormatter.formatString = "YYYY-MM-DDTJJ:NN:SS"
|
93
|
+
return dateFormatter.format(timestamp) + "Z";
|
94
|
+
}
|
95
|
+
internal static function getBase64Digest(nonce:String, created:String, password:String):String
|
96
|
+
{
|
97
|
+
return SHA1.hashToBase64(nonce + created + password);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
@@ -0,0 +1,107 @@
|
|
1
|
+
////////////////////////////////////////////////////////////////////////////////
|
2
|
+
//
|
3
|
+
// Copyright(c) 2006 Adobe Systems Incorporated. All Rights Reserved.
|
4
|
+
//
|
5
|
+
////////////////////////////////////////////////////////////////////////////////
|
6
|
+
package com.adobe.effects
|
7
|
+
{
|
8
|
+
import mx.effects.EffectInstance;
|
9
|
+
import mx.effects.TweenEffect;
|
10
|
+
import mx.effects.IEffectInstance;
|
11
|
+
/**
|
12
|
+
* The SaturationFade effect changes the <code>filters</code> property of a component,
|
13
|
+
* adding a ColorMatrixFilter to affect it's color saturation level. A saturation
|
14
|
+
* level of 1.0 indicates the current color saturation level and a saturnation level
|
15
|
+
* of 0.0 indicates no color saturation (ie. grayscale). A saturation of -1.0 inverts
|
16
|
+
* the colors of the target.
|
17
|
+
*
|
18
|
+
* <p>If you omit values for the
|
19
|
+
* <code>saturationFrom</code> and <code>saturationTo</code> properties,
|
20
|
+
* the effect automatically transitions from a saturation level of 1.0 to 0.0
|
21
|
+
*
|
22
|
+
* @mxml
|
23
|
+
*
|
24
|
+
* <p>The <code><mx:SaturationFade></code> tag
|
25
|
+
* inherits the tag attributes of its superclass,
|
26
|
+
* and adds the following tag attributes:</p>
|
27
|
+
*
|
28
|
+
* <pre>
|
29
|
+
* <mx:SaturationFade
|
30
|
+
* id="ID"
|
31
|
+
* saturationFrom="val"
|
32
|
+
* saturationTo="val"
|
33
|
+
* />
|
34
|
+
* </pre>
|
35
|
+
*
|
36
|
+
* @see com.adobe.effects.SaturationFadeInstance
|
37
|
+
*
|
38
|
+
*/
|
39
|
+
public class SaturationFade extends TweenEffect
|
40
|
+
{
|
41
|
+
//--------------------------------------------------------------------------
|
42
|
+
//
|
43
|
+
// Class constants
|
44
|
+
//
|
45
|
+
//--------------------------------------------------------------------------
|
46
|
+
/**
|
47
|
+
* @private
|
48
|
+
*/
|
49
|
+
private static var AFFECTED_PROPERTIES:Array = [ "filters" ];
|
50
|
+
//--------------------------------------------------------------------------
|
51
|
+
//
|
52
|
+
// Constructor
|
53
|
+
//
|
54
|
+
//--------------------------------------------------------------------------
|
55
|
+
/**
|
56
|
+
* Constructor.
|
57
|
+
*
|
58
|
+
* @param target The Object to animate with this effect.
|
59
|
+
*/
|
60
|
+
public function SaturationFade( target : Object = null )
|
61
|
+
{
|
62
|
+
super( target );
|
63
|
+
instanceClass = SaturationFadeInstance;
|
64
|
+
}
|
65
|
+
//--------------------------------------------------------------------------
|
66
|
+
//
|
67
|
+
// Properties
|
68
|
+
//
|
69
|
+
//--------------------------------------------------------------------------
|
70
|
+
[Inspectable(category="General", defaultValue="undefined")]
|
71
|
+
/**
|
72
|
+
* Initial saturation level. 0.0 means grayscale, 1.0 means
|
73
|
+
* the original saturation level and numbers greater than
|
74
|
+
* 1.0 increase the saturation beyonds its original level
|
75
|
+
*/
|
76
|
+
public var saturationFrom:Number;
|
77
|
+
[Inspectable(category="General", defaultValue="undefined")]
|
78
|
+
/**
|
79
|
+
* Final saturation level. 0.0 means grayscale, 1.0 means
|
80
|
+
* the original saturation level and numbers greater than
|
81
|
+
* 1.0 increase the saturation beyonds its original level
|
82
|
+
*/
|
83
|
+
public var saturationTo:Number;
|
84
|
+
//--------------------------------------------------------------------------
|
85
|
+
//
|
86
|
+
// Overridden methods
|
87
|
+
//
|
88
|
+
//--------------------------------------------------------------------------
|
89
|
+
/**
|
90
|
+
* @private
|
91
|
+
*/
|
92
|
+
override public function getAffectedProperties():Array /* of String */
|
93
|
+
{
|
94
|
+
return AFFECTED_PROPERTIES;
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* @private
|
98
|
+
*/
|
99
|
+
override protected function initInstance(instance:IEffectInstance):void
|
100
|
+
{
|
101
|
+
super.initInstance( instance );
|
102
|
+
var saturationInstance:SaturationFadeInstance = SaturationFadeInstance( instance );
|
103
|
+
saturationInstance.saturationFrom = saturationFrom;
|
104
|
+
saturationInstance.saturationTo = saturationTo;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|