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 java.lang.Object
implements Encryption


Constructor Summary
BasicEncryption(java.util.Map<java.lang.String,java.lang.String> params)
           
 
Method Summary
static java.lang.String base64Encode(byte[] data)
          encode the input data producing a base 64 encoded byte array.
static int base64Encode(byte[] data, int off, int length, java.io.OutputStream out)
          encode the input data producing a base 64 output stream.
 boolean checkPassword(java.lang.String provided, java.lang.String real)
           Check password.
 java.lang.String encryptPassword(java.lang.String password)
           Encrypt a password.
static java.lang.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(java.util.Map<java.lang.String,java.lang.String> params)
Method Detail

encryptPassword

public java.lang.String encryptPassword(java.lang.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(java.lang.String provided,
                             java.lang.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 java.lang.String hexEncode(byte[] in)

base64Encode

public static java.lang.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,
                               java.io.OutputStream out)
                        throws java.io.IOException
encode the input data producing a base 64 output stream.

Returns:
the number of bytes produced.
Throws:
java.io.IOException


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.