001    /**
002     * Implements the Cold Fusion Function encrypt
003     */
004    package railo.runtime.functions.other;
005    
006    import railo.runtime.PageContext;
007    import railo.runtime.exp.PageException;
008    import railo.runtime.ext.function.Function;
009    import railo.runtime.op.Caster;
010    
011    //FUTURE 2 attr fehlen noch
012    
013    public final class EncryptBinary implements Function {
014            
015        public synchronized static Object call(PageContext pc , Object oBytes, String key) throws PageException {
016                    return call(pc,oBytes,key,"cfmx_compat");
017            }
018        
019        public synchronized static Object call(PageContext pc , Object oBytes, String key, String algorithm) throws PageException {
020                    return Encrypt.invoke(Caster.toBinary(oBytes), key, algorithm);
021            
022            }
023        
024    }