Bees v0.5.0 API

bees.core
Class CipheredXdrByteArray

java.lang.Object
  |
  +--bees.core.ByteArray
        |
        +--bees.core.XdrByteArray
              |
              +--bees.core.CipheredXdrByteArray

public class CipheredXdrByteArray
extends XdrByteArray

A CipheredXdrByteArray is a convenience for encrypting/decrypting an XdrByteArray.


Fields inherited from class bees.core.XdrByteArray
index
 
Fields inherited from class bees.core.ByteArray
buf, len, offset
 
Constructor Summary
CipheredXdrByteArray(byte[] buf, byte[] iv, java.lang.String algorithm)
          Construct a CipheredXdrByteArray with the given values.
CipheredXdrByteArray(byte[] buf, java.lang.String algorithm)
          Construct a CipheredXdrByteArray with the given values.
CipheredXdrByteArray(int len, java.lang.String algorithm)
          Construct a CipheredXdrByteArray with the given values.
 
Method Summary
 void decrypt(KeySpec ks)
           
 void encrypt(KeySpec ks)
           
 java.lang.String getAlgorithm()
           
 byte[] getIV()
           
 java.lang.String toString()
           
 
Methods inherited from class bees.core.XdrByteArray
BOOLEAN, BYTE, BYTEARRAY, BYTES, BYTES, DOUBLE, FLOAT, INT, LEINT, LELONG, LESHORT, LONG, PUT, PUT, PUT, PUT, PUT, PUT, PUT, PUT, PUT, PUT, PUT, PUTLE, PUTLE, PUTLE, SHORT, SKIP, STRING
 
Methods inherited from class bees.core.ByteArray
concat, concat, fromFile, getByte, getBytes, length, setByte, setBytes, setBytes, toBytes, toFile, toPlainString, toPlainString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CipheredXdrByteArray

public CipheredXdrByteArray(int len,
                            java.lang.String algorithm)
Construct a CipheredXdrByteArray with the given values.
Parameters:
len - The length of the byte array.
algorithm - The name of the cryptographic algorithm to use.

CipheredXdrByteArray

public CipheredXdrByteArray(byte[] buf,
                            java.lang.String algorithm)
Construct a CipheredXdrByteArray with the given values.
Parameters:
buf - The byte array to wrap.
algorithm - The name of the cryptographic algorithm to use.

CipheredXdrByteArray

public CipheredXdrByteArray(byte[] buf,
                            byte[] iv,
                            java.lang.String algorithm)
Construct a CipheredXdrByteArray with the given values.
Parameters:
buf - The byte array to wrap.
iv - The initialization vector for "buf".
algorithm - The name of the cryptographic algorithm to use.
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Returns:
The name of the cryptographic algorithm to use.

getIV

public byte[] getIV()
Returns:
The initialization vector.

encrypt

public void encrypt(KeySpec ks)
             throws javax.crypto.IllegalBlockSizeException,
                    java.security.NoSuchAlgorithmException,
                    javax.crypto.NoSuchPaddingException,
                    javax.crypto.BadPaddingException,
                    java.security.InvalidKeyException
Parameters:
ks - The KeySpec to use when encrypting this byte array.
Throws:
javax.crypto.IllegalBlockSizeException -  
java.security.NoSuchAlgorithmException -  
javax.crypto.NoSuchPaddingException -  
javax.crypto.BadPaddingException -  
java.security.InvalidKeyException -  

decrypt

public void decrypt(KeySpec ks)
             throws java.security.InvalidAlgorithmParameterException,
                    javax.crypto.IllegalBlockSizeException,
                    java.security.NoSuchAlgorithmException,
                    javax.crypto.NoSuchPaddingException,
                    javax.crypto.BadPaddingException,
                    java.security.InvalidKeyException
Parameters:
ks - The KeySpec to use when verifying this byte array.
Throws:
java.security.InvalidAlgorithmParameterException -  
javax.crypto.IllegalBlockSizeException -  
java.security.NoSuchAlgorithmException -  
javax.crypto.NoSuchPaddingException -  
javax.crypto.BadPaddingException -  
java.security.InvalidKeyException -  

toString

public java.lang.String toString()
Overrides:
toString in class XdrByteArray
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/