Java Code Examples for org.gluu.util.security.StringEncrypter#instance()

The following examples show how to use org.gluu.util.security.StringEncrypter#instance() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: oxTrust   File: AppInitializer.java    License: MIT License 6 votes vote down vote up
@Produces
@ApplicationScoped
public StringEncrypter getStringEncrypter() throws OxIntializationException {
	String encodeSalt = configurationFactory.getCryptoConfigurationSalt();

	if (StringHelper.isEmpty(encodeSalt)) {
		throw new OxIntializationException("Encode salt isn't defined");
	}

	try {
		StringEncrypter stringEncrypter = StringEncrypter.instance(encodeSalt);

		return stringEncrypter;
	} catch (EncryptionException ex) {
		throw new OxIntializationException("Failed to create StringEncrypter instance");
	}
}
 
Example 2
Source Project: oxAuth   File: AppInitializer.java    License: MIT License 6 votes vote down vote up
@Produces
@ApplicationScoped
public StringEncrypter getStringEncrypter() {
	String encodeSalt = configurationFactory.getCryptoConfigurationSalt();

	if (StringHelper.isEmpty(encodeSalt)) {
		throw new ConfigurationException("Encode salt isn't defined");
	}

	try {
		StringEncrypter stringEncrypter = StringEncrypter.instance(encodeSalt);

		return stringEncrypter;
	} catch (EncryptionException ex) {
		throw new ConfigurationException("Failed to create StringEncrypter instance");
	}
}
 
Example 3
Source Project: oxd   File: UtilsTest.java    License: Apache License 2.0 4 votes vote down vote up
@Test(enabled = false)
public void decrypt() throws StringEncrypter.EncryptionException {
    StringEncrypter stringEncrypter = StringEncrypter.instance("123456789012345678901234");
    System.out.println(stringEncrypter.decrypt(""));
}