Tabnine Logo
CryptoEngine.crypt
Code IndexAdd Tabnine to your IDE (free)

How to use
crypt
method
in
bitronix.tm.utils.CryptoEngine

Best Java code snippets using bitronix.tm.utils.CryptoEngine.crypt (Showing top 8 results out of 315)

origin: org.codehaus.btm/btm

/**
 * Main method of this class to be used as a command-line tool to get a crypted version of a resource password.
 * @param args the command-line arguments.
 * @throws Exception when an error occurs crypting the given resource password.
 */
public static void main(String[] args) throws Exception {
  System.out.println("Bitronix Transaction Manager " + Version.getVersion() + " password property crypter");
  System.out.flush();
  if (args.length < 1 || args.length > 2) {
    System.err.println("Usage: CryptoEngine <password> [cipher]");
    System.err.println("  where:");
    System.err.println("    <password> is mandatory and is the resource password to crypt");
    System.err.println("    [cipher]   is optional and is the cipher to be used to crypt the password");
    System.exit(1);
  }
  String data = args[0];
  String cipher = "DES";
  if (args.length > 1)
    cipher = args[1];
  String propertyValue = "{" + cipher + "}" + crypt(cipher, data);
  System.out.println("crypted password property value: " + propertyValue);
}
origin: com.github.marcus-nl.btm/btm

/**
 * Main method of this class to be used as a command-line tool to get a crypted version of a resource password.
 * @param args the command-line arguments.
 * @throws Exception when an error occurs crypting the given resource password.
 */
public static void main(String[] args) throws Exception {
  System.out.println("Bitronix Transaction Manager " + Version.getVersion() + " password property crypter");
  System.out.flush();
  if (args.length < 1 || args.length > 2) {
    System.err.println("Usage: CryptoEngine <password> [cipher]");
    System.err.println("  where:");
    System.err.println("    <password> is mandatory and is the resource password to crypt");
    System.err.println("    [cipher]   is optional and is the cipher to be used to crypt the password");
    System.exit(1);
  }
  String data = args[0];
  String cipher = "DES";
  if (args.length > 1)
    cipher = args[1];
  String propertyValue = "{" + cipher + "}" + crypt(cipher, data);
  System.out.println("crypted password property value: " + propertyValue);
}
origin: bitronix/btm

/**
 * Main method of this class to be used as a command-line tool to get a crypted version of a resource password.
 * @param args the command-line arguments.
 * @throws Exception when an error occurs crypting the given resource password.
 */
public static void main(String[] args) throws Exception {
  System.out.println("Bitronix Transaction Manager " + Version.getVersion() + " password property crypter");
  System.out.flush();
  if (args.length < 1 || args.length > 2) {
    System.err.println("Usage: CryptoEngine <password> [cipher]");
    System.err.println("  where:");
    System.err.println("    <password> is mandatory and is the resource password to crypt");
    System.err.println("    [cipher]   is optional and is the cipher to be used to crypt the password");
    System.exit(1);
  }
  String data = args[0];
  String cipher = "DES";
  if (args.length > 1)
    cipher = args[1];
  String propertyValue = "{" + cipher + "}" + crypt(cipher, data);
  System.out.println("crypted password property value: " + propertyValue);
}
origin: org.mule.btm/mule-btm

/**
 * Main method of this class to be used as a command-line tool to get a crypted version of a resource password.
 * @param args the command-line arguments.
 * @throws Exception when an error occurs crypting the given resource password.
 */
public static void main(String[] args) throws Exception {
  System.out.println("Bitronix Transaction Manager " + Version.getVersion() + " password property crypter");
  System.out.flush();
  if (args.length < 1 || args.length > 2) {
    System.err.println("Usage: CryptoEngine <password> [cipher]");
    System.err.println("  where:");
    System.err.println("    <password> is mandatory and is the resource password to crypt");
    System.err.println("    [cipher]   is optional and is the cipher to be used to crypt the password");
    System.exit(1);
  }
  String data = args[0];
  String cipher = "DES";
  if (args.length > 1)
    cipher = args[1];
  String propertyValue = "{" + cipher + "}" + crypt(cipher, data);
  System.out.println("crypted password property value: " + propertyValue);
}
origin: bitronix/btm

public void testCrypt() throws Exception {
  String textToCrypt = "java";
  String cypherText = CryptoEngine.crypt("DES", textToCrypt);
  String decryptedText = CryptoEngine.decrypt("DES", cypherText);
  assertEquals(textToCrypt, decryptedText);
}
origin: com.github.marcus-nl.btm/btm

public void testCrypt() throws Exception {
  String textToCrypt = "java";
  String cypherText = CryptoEngine.crypt("DES", textToCrypt);
  String decryptedText = CryptoEngine.decrypt("DES", cypherText);
  assertEquals(textToCrypt, decryptedText);
}
origin: bitronix/btm

public void testBuildXAFactory() throws Exception {
  ResourceBean rb = new ResourceBean() {};
  rb.setMaxPoolSize(1);
  rb.setClassName(MockitoXADataSource.class.getName());
  rb.getDriverProperties().setProperty("userName", "java");
  rb.getDriverProperties().setProperty("password", "{DES}" + CryptoEngine.crypt("DES", "java"));
  XAPool<DummyResourceHolder, DummyStatefulHolder> xaPool = new XAPool<DummyResourceHolder, DummyStatefulHolder>(null, rb, null);
  assertEquals(0, xaPool.totalPoolSize());
  assertEquals(0, xaPool.inPoolSize());
  MockitoXADataSource xads = (MockitoXADataSource) xaPool.getXAFactory();
  assertEquals("java", xads.getUserName());
  assertEquals("java", xads.getPassword());
}
origin: com.github.marcus-nl.btm/btm

public void testBuildXAFactory() throws Exception {
  ResourceBean rb = new ResourceBean() {};
  rb.setMaxPoolSize(1);
  rb.setClassName(MockitoXADataSource.class.getName());
  rb.getDriverProperties().setProperty("userName", "java");
  rb.getDriverProperties().setProperty("password", "{DES}" + CryptoEngine.crypt("DES", "java"));
  XAPool<DummyResourceHolder, DummyStatefulHolder> xaPool = new XAPool<DummyResourceHolder, DummyStatefulHolder>(null, rb, null);
  assertEquals(0, xaPool.totalPoolSize());
  assertEquals(0, xaPool.inPoolSize());
  MockitoXADataSource xads = (MockitoXADataSource) xaPool.getXAFactory();
  assertEquals("java", xads.getUserName());
  assertEquals("java", xads.getPassword());
}
bitronix.tm.utilsCryptoEnginecrypt

Javadoc

Crypt the given data using the given cipher. The crypted result is base64-encoded before it is returned.

Popular methods of CryptoEngine

  • decrypt
    Decrypt using the given cipher the given base64-encoded, crypted data.
  • loadKeySpec

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now