TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.crypto.raes.param
Class AesCipherParameters

java.lang.Object
  extended by de.schlichtherle.truezip.crypto.raes.param.AesCipherParameters
All Implemented Interfaces:
SafeKey<AesCipherParameters>, Cloneable

@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public final class AesCipherParameters
extends Object
implements SafeKey<AesCipherParameters>, Cloneable

A Java bean which holds AES cipher parameters.

Author:
Christian Schlichtherle

Field Summary
private  Type0RaesParameters.KeyStrength keyStrength
           
private  char[] password
           
 
Constructor Summary
AesCipherParameters()
           
 
Method Summary
 AesCipherParameters clone()
          Returns a clone of this safe key or this if and only if the implementation is immutable.
 Type0RaesParameters.KeyStrength getKeyStrength()
          Returns the AES cipher key strength, which defaults to Type0RaesParameters.KeyStrength.BITS_256.
 char[] getPassword()
          Returns a protective copy of the password char array.
 void reset()
          Resets this safe key to it's initial state, wiping any data from heap, or does nothing if and only if the implementation is immutable.
 void setKeyFileBytes(byte[] bytes)
          Decodes the given byte array to a password char array for subsequent use.
 void setKeyStrength(Type0RaesParameters.KeyStrength keyStrength)
          Sets the AES cipher key strength.
 void setPassword(char[] newPW)
          Copies the given password char array for subsequent use as the AES cipher key.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyStrength

private Type0RaesParameters.KeyStrength keyStrength

password

@CheckForNull
private char[] password
Constructor Detail

AesCipherParameters

public AesCipherParameters()
Method Detail

clone

public AesCipherParameters clone()
Description copied from interface: SafeKey
Returns a clone of this safe key or this if and only if the implementation is immutable.

Specified by:
clone in interface SafeKey<AesCipherParameters>
Overrides:
clone in class Object

reset

public void reset()
Description copied from interface: SafeKey
Resets this safe key to it's initial state, wiping any data from heap, or does nothing if and only if the implementation is immutable.

Specified by:
reset in interface SafeKey<AesCipherParameters>

getPassword

@Nullable
public char[] getPassword()
Returns a protective copy of the password char array.

Returns:
A protective copy of the password char array.

setPassword

public void setPassword(@CheckForNull
                        char[] newPW)
Copies the given password char array for subsequent use as the AES cipher key.

This method makes a protective copy of the given password char array. It's highly recommended to overwrite this array with any non-password data after calling this method.

Parameters:
newPW - the password char array to be copied for subsequent use.

setKeyFileBytes

public void setKeyFileBytes(@CheckForNull
                            byte[] bytes)
Decodes the given byte array to a password char array for subsequent use. This method should be used if a key file is used rather than a password.

This method makes a protective copy of the given key file byte array. It's highly recommended to overwrite this array with any non-password data after calling this method.

Parameters:
bytes - the byte array to decode.

getKeyStrength

public Type0RaesParameters.KeyStrength getKeyStrength()
Returns the AES cipher key strength, which defaults to Type0RaesParameters.KeyStrength.BITS_256.

Returns:
The AES cipher key strength, which defaults to Type0RaesParameters.KeyStrength.BITS_256.

setKeyStrength

public void setKeyStrength(Type0RaesParameters.KeyStrength keyStrength)
Sets the AES cipher key strength.

Parameters:
keyStrength - the AES cipher key strength.

TrueZIP Driver ZIP.RAES (TZP) 7.1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.