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.
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. |
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 |
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.
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()
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/