public static String DE(final String ciphertext, final String key) throws Exception { AesCbcWithIntegrity.SecretKeys skey = AesCbcWithIntegrity.keys(key); AesCbcWithIntegrity.CipherTextIvMac civ = new AesCbcWithIntegrity.CipherTextIvMac(ciphertext); return AesCbcWithIntegrity.decryptString(civ, skey); }
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }
/** * returns all of the mail settings, use from pooled connections with jndi * * @return */ public static Properties LoadSLAPropertiesPooled() { Connection con = Utility.getConfigurationDBConnection(); Properties p = loadSLAProperties(con); DBUtils.safeClose(con); return p; }
private void print(StatisticsContainer s) { log.log(Level.DEBUG, s.timeperiod + " " + s.uri + " " + s.action + " " + s.success + " " + s.faults + " " + s.averageresponsetime + " " + s.max_request_size + " " + s.max_response_size + " " + s.max_responsetime + " " + s.mtbf + " " + s.availibity); }
/** * Returns the current machine's hostname using * InetAddress.getLocalHost().getHostName().toLowerCase(); The hostname will * always be lower case. This function should never throw an exception. If * the current machine does not have a valid hostname or it is not dns * resolvable, then "ADDRESS_UNKNOWN" is returned * * @return */ public static String GetHostName() { return Utility.getHostName(); }
/** * Construct the secret keys container. * @param confidentialityKeyIn The AES key * @param integrityKeyIn the HMAC key */ public SecretKeys(SecretKey confidentialityKeyIn, SecretKey integrityKeyIn) { setConfidentialityKey(confidentialityKeyIn); setIntegrityKey(integrityKeyIn); }
/** * Creates a random Initialization Vector (IV) of IV_LENGTH_BYTES. * * @return The byte array of this IV * @throws GeneralSecurityException if a suitable RNG is not available */ public static byte[] generateIv() throws GeneralSecurityException { return randomBytes(IV_LENGTH_BYTES); }
/** * Generate a new AES 256 bit encryption key. Once generated, this key can * be used to replace the default key. * * @return */ public static String GEN() { return GEN((short) 128); }
/** * Converts the given AES/HMAC keys into a base64 encoded string suitable for * storage. Sister function of keys. * * @param keys The combined aes and hmac keys * @return a base 64 encoded AES string & hmac key as base64(aesKey) : base64(hmacKey) */ public static String keyString(SecretKeys keys) { return keys.toString(); }
@Override protected byte[] engineGenerateSeed(int size) { byte[] seed = new byte[size]; engineNextBytes(seed); return seed; }
/** * Applies all fixes. * * @throws SecurityException if a fix is needed but could not be * applied. */ public static void apply() { applyOpenSSLFix(); //installLinuxPRNGSecureRandom(); }
public static InternetAddress[] GetAllfgsmsAdminsEmailAddressPooled() { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); InternetAddress[] sp = getAllfgsmsAdminsEmailAddress(con); DBUtils.safeClose(con); return sp; }
public StatusHelper(String username, String password, org.miloss.fgsms.common.Constants.AuthMode mode, String keystore, String keystorepassword, String truststore, String truststorepassword) { try { this.username = username; this.password = password; this.mode = mode; } catch (Exception ex) { log.log(Level.WARN, "error initializing ssl sockets ", ex); } } private static final Logger log = LogHelper.getLog();
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }
/** * Generates a random salt. * @return The random salt suitable for generateKeyFromPassword. */ public static byte[] generateSalt() throws GeneralSecurityException { return randomBytes(PBE_SALT_LENGTH_BITS); }
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }
@Override public List<PolicyType> GetAppliesTo() { return Utility.getAllPolicyTypes(); } }