Examples of ScriptusRuntimeException


Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    try {
      Cipher cipher = Cipher.getInstance(cipherScheme);
      cipher.init(Cipher.DECRYPT_MODE, key);
      return cipher.doFinal(ciphertext);
    } catch (Exception e) {
      throw new ScriptusRuntimeException("problem with cipher", e);
    }
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    return fromHex(hex, -1);
  }
  public static byte[] fromHex(String hex, int expectedLength) {
   
    if(hex == null) {
      throw new ScriptusRuntimeException("hex string should not be null");
    }
    if (hex.length() % 2 == 1) {
      RuntimeException e = new ScriptusRuntimeException("Hex.length="+hex.length());
      e.printStackTrace();
      throw e;
    }
    if(expectedLength != -1 && hex.length() / 2 != expectedLength) {
      throw new ScriptusRuntimeException("Expected "+expectedLength+" bytes, got "+hex.length() / 2);
    }
    byte[] result = new byte[hex.length() / 2];
    for (int i = 0; i != result.length; i++) {
      result[i] = Integer.valueOf(hex.substring(i * 2, i * 2 + 2), 16).byteValue();
    }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    try {
      MessageDigest md = MessageDigest.getInstance(hash);
      md.update(str);
      return md.digest();
    } catch (Exception e) {
      throw new ScriptusRuntimeException("probmem with hash", e);
    }
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

        mac.init(key);

        return mac.doFinal(plaintext);
       
            } catch (Exception e) {
                throw new ScriptusRuntimeException("problem with mac", e);
            }
      
        }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

   
    ScheduledScriptAction a;
    try {
      a = (ScheduledScriptAction) Class.forName(klazz).newInstance();
    } catch (InstantiationException e) {
      throw new ScriptusRuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new ScriptusRuntimeException(e);
    } catch (ClassNotFoundException e) {
      throw new ScriptusRuntimeException(e);
    }
    a.fromString(s);
   
    return a;
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.