edu.vt.middleware.crypt.KeyWithIV Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vt-crypt Show documentation
Show all versions of vt-crypt Show documentation
Library for performing common cryptographic operations
/*
$Id$
Copyright (C) 2007-2010 Virginia Tech.
All rights reserved.
SEE LICENSE FOR MORE INFORMATION
Author: Middleware Services
Email: [email protected]
Version: $Revision$
Updated: $Date$
*/
package edu.vt.middleware.crypt;
import javax.crypto.SecretKey;
/**
* Container for a symmetric key and IV generated from a passphrase for use in
* PBE encryption.
*
* @author Middleware Services
* @version $Revision: 3 $
*/
public class KeyWithIV
{
/** Symmetric key. */
private SecretKey secretKey;
/** Initialization vector. */
private byte[] iv;
/**
* Creates a new instance from the given key and IV.
*
* @param key Symmetric key.
* @param ivBytes Initialization vector bytes.
*/
KeyWithIV(final SecretKey key, final byte[] ivBytes)
{
this.secretKey = key;
this.iv = ivBytes;
}
/**
* Gets the symmetric key.
*
* @return Symmetric encryption key.
*/
public SecretKey getKey()
{
return secretKey;
}
/**
* Gets the initialization vector.
*
* @return IV bytes.
*/
public byte[] getIV()
{
return iv;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy