User: luke_t
Date: 01/12/19 16:58:34
Modified: src/main/org/jboss/security Base64Encoder.java
Log:
reinstated usage msg in main (accidentally deleted).
Revision Changes Path
1.2 +9 -1 jbosssx/src/main/org/jboss/security/Base64Encoder.java
Index: Base64Encoder.java
===================================================================
RCS file: /cvsroot/jboss/jbosssx/src/main/org/jboss/security/Base64Encoder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Base64Encoder.java 2001/12/18 21:31:49 1.1
+++ Base64Encoder.java 2001/12/20 00:58:34 1.2
@@ -105,11 +105,15 @@
}
/**
- * Testing the encoder.
* Run with one argument, prints the encoded version of it.
* With two, the second is assumed to be the name of a MessageDigest to
* be applied to the string before encoding (useful for generating
* password hashes).
+ * <p>
+ * Alternatively, use the openssl utility, for example:
+ * <p>
+ * echo -n "password" | openssl dgst -sha1 -binary | openssl base64
+ *
*/
public static void main (String args[]) throws Exception
{
@@ -123,6 +127,10 @@
{
byte[] hash =
java.security.MessageDigest.getInstance(args[1]).digest(args[0].getBytes());
System.out.println ("["+ Base64Encoder.encode(hash)+"]");
+ }
+ else
+ {
+ System.out.println("Usage: Base64Encoder <string> <optional hash
algorithm>");
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development