org.basex.query.util.crypto
Class Encryption

java.lang.Object
  extended by org.basex.query.util.crypto.Encryption

public final class Encryption
extends java.lang.Object

This class encrypts and decrypts textual inputs.

Author:
BaseX Team 2005-12, BSD License, Lukas Kircher

Constructor Summary
Encryption(InputInfo ii)
          Constructor.
 
Method Summary
 Str encryption(byte[] in, byte[] s, byte[] k, byte[] a, boolean ec)
          Encrypts or decrypts the given input.
 Item hmac(byte[] msg, byte[] k, byte[] a, byte[] enc)
          Creates a message authentication code (MAC) for the given input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encryption

public Encryption(InputInfo ii)
Constructor.

Parameters:
ii - input info
Method Detail

encryption

public Str encryption(byte[] in,
                      byte[] s,
                      byte[] k,
                      byte[] a,
                      boolean ec)
               throws QueryException
Encrypts or decrypts the given input.

Parameters:
in - input
s - encryption type
k - secret key
a - encryption algorithm
ec - encrypt or decrypt
Returns:
encrypted or decrypted input
Throws:
QueryException - query exception

hmac

public Item hmac(byte[] msg,
                 byte[] k,
                 byte[] a,
                 byte[] enc)
          throws QueryException
Creates a message authentication code (MAC) for the given input.

Parameters:
msg - input
k - secret key
a - encryption algorithm
enc - encoding
Returns:
MAC
Throws:
QueryException - query exception