org.apache.karaf.jaas.modules.encryption
Class BasicEncryption

java.lang.Object
  extended by org.apache.karaf.jaas.modules.encryption.BasicEncryption
All Implemented Interfaces:
Encryption

public class BasicEncryption
extends Object
implements Encryption


Constructor Summary
BasicEncryption(Map<String,String> params)
           
 
Method Summary
static String base64Encode(byte[] data)
          encode the input data producing a base 64 encoded byte array.
static int base64Encode(byte[] data, int off, int length, OutputStream out)
          encode the input data producing a base 64 output stream.
 boolean checkPassword(String provided, String real)
           Check password.
 String encryptPassword(String password)
           Encrypt a password.
static String hexEncode(byte[] in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicEncryption

public BasicEncryption(Map<String,String> params)
Method Detail

encryptPassword

public String encryptPassword(String password)
Description copied from interface: Encryption

Encrypt a password.

Specified by:
encryptPassword in interface Encryption
Parameters:
password - the password in plain format.
Returns:
the encrypted password format.

checkPassword

public boolean checkPassword(String provided,
                             String real)
Description copied from interface: Encryption

Check password.

Specified by:
checkPassword in interface Encryption
Parameters:
provided - password provided in plain format.
real - the encrypted format to compare with.
Returns:
true if the password match, false else.

hexEncode

public static String hexEncode(byte[] in)

base64Encode

public static String base64Encode(byte[] data)
encode the input data producing a base 64 encoded byte array.

Returns:
a byte array containing the base 64 encoded data.

base64Encode

public static int base64Encode(byte[] data,
                               int off,
                               int length,
                               OutputStream out)
                        throws IOException
encode the input data producing a base 64 output stream.

Returns:
the number of bytes produced.
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.