Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.commons.crypto.cipher.CryptoCipher

    public void testDefaultCipher() throws GeneralSecurityException {

CryptoCipher defaultCipher = CryptoCipherFactory


final String name = defaultCipher.getClass().getName();

if (OpenSsl.getLoadingFailureReason() == null) {

Assert.assertEquals(OpenSslCipher.class.getName(), name);

} else {

Assert.assertEquals(JceCipher.class.getName(), name);



   Like      Feedback      org.apache.commons.crypto.cipher.CryptoCipher

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner

comments powered by Disqus