com.autonomy.encryption
Class BTEAEncrypt

java.lang.Object
  extended bycom.autonomy.encryption.BTEABase
      extended bycom.autonomy.encryption.BTEAEncrypt

public class BTEAEncrypt
extends com.autonomy.encryption.BTEABase

Class for encrypting strings using the BTEA scheme.


Field Summary
static int ENCRYPT_COMPRESSION_LEVEL
           
static int ENCRYPT_ERRORBADPARAMETER
           
static int ENCRYPT_SUCCESS
           
 
Constructor Summary
BTEAEncrypt()
           
 
Method Summary
static java.lang.String binToHex(byte[] enc)
           
static java.lang.String encrypt(java.lang.String sToEncrypt, BTEAEncryptionDetails encryptionDetails)
          Encrypt a string for use with an IDOL server.
static java.lang.String encrypt(java.lang.String sToEncrypt, long[] alKeys, java.lang.String sEncoding)
          Encrypt a string for use with an IDOL server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCRYPT_SUCCESS

public static int ENCRYPT_SUCCESS

ENCRYPT_ERRORBADPARAMETER

public static int ENCRYPT_ERRORBADPARAMETER

ENCRYPT_COMPRESSION_LEVEL

public static int ENCRYPT_COMPRESSION_LEVEL
Constructor Detail

BTEAEncrypt

public BTEAEncrypt()
Method Detail

encrypt

public static java.lang.String encrypt(java.lang.String sToEncrypt,
                                       BTEAEncryptionDetails encryptionDetails)
                                throws java.io.UnsupportedEncodingException,
                                       EncryptionException
Encrypt a string for use with an IDOL server.

Parameters:
sToEncrypt - the string to encrypt.
encryptionDetails - the details of the encryption scheme to use.
Returns:
the encrypted, base 64 encoded string.
Throws:
java.io.UnsupportedEncodingException - if the encoding set in the encryption details is not supported by the JVM.
EncryptionException

encrypt

public static java.lang.String encrypt(java.lang.String sToEncrypt,
                                       long[] alKeys,
                                       java.lang.String sEncoding)
                                throws java.io.UnsupportedEncodingException,
                                       EncryptionException
Encrypt a string for use with an IDOL server.

Parameters:
sToEncrypt - the string to encrypt.
alKeys - an array of length 4 giving the encryption keys to use.
sEncoding - the character encoding to use when encrypting.
Returns:
the encrypted, base 64 encoded string.
Throws:
java.io.UnsupportedEncodingException - if the encoding set in the encryption details is not supported by the JVM.
EncryptionException

binToHex

public static java.lang.String binToHex(byte[] enc)
                                 throws java.lang.ArrayIndexOutOfBoundsException
Throws:
java.lang.ArrayIndexOutOfBoundsException