TrueZIP 6.8.3

de.schlichtherle.crypto.io.raes
Class KeyManagerRaesParameters

java.lang.Object
  extended by de.schlichtherle.crypto.io.raes.KeyManagerRaesParameters
All Implemented Interfaces:
RaesParameters, RaesParametersAgent

public class KeyManagerRaesParameters
extends Object
implements RaesParametersAgent

A facade which retrieves RaesParameters by using the KeyManager. The KeyManager usually prompts the user via a pluggable user interface.

According to the current state of RAES, only password based encryption is supported. The facade pattern allows this class to be changed to support other encryption and authentication schemes in the future without requiring to change the client code.

Implementation note: Of course this class could implement Type0RaesParameters directly. But then this interface and all its methods would be public. However, it is anticipated that with the advent of additional parameter interfaces for new RAES types, the explicit implementation of interfaces would limit this classes ability to implement preferences for certain RAES types. Now, implementing the RaesParametersAgent interface allows us to control the search for suitable RAES parameters according to the user's preferences, whereas any direct implementation of these interfaces would put us at the mercy of RaesOutputStream!

Since:
TrueZIP 6.0
Author:
Christian Schlichtherle

Nested Class Summary
private  class KeyManagerRaesParameters.Type0
          An adapter which presents the KeyManager's KeyProvider interface as Type0RaesParameters}.
 
Field Summary
private  String cPath
           
 
Constructor Summary
KeyManagerRaesParameters(String cPath)
          Constructs a new set of default RAES parameters.
 
Method Summary
 RaesParameters getParameters(Class type)
          Requests an RaesParameters instance of the given type.
private static char[] PKCS12BytesToChars(byte[] bytes)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cPath

private final String cPath
Constructor Detail

KeyManagerRaesParameters

public KeyManagerRaesParameters(String cPath)
Constructs a new set of default RAES parameters.

Parameters:
cPath - The canonical pathname of the RAES file - null is not allowed!
Method Detail

getParameters

public RaesParameters getParameters(Class type)
Description copied from interface: RaesParametersAgent
Requests an RaesParameters instance of the given type. It is permissible to return an instance of any other implementation of the RaesParameters interface. If the returned object is an instance of an implementation of this interface, it will be used to continue the search for RAES parameters recursively. Otherwise the search will be aborted.

Specified by:
getParameters in interface RaesParametersAgent
Parameters:
type - The RaesParameters interface class which's implementation is searched.
Returns:
An instance of RaesParameters or null if no RAES parameters are available.

PKCS12BytesToChars

private static char[] PKCS12BytesToChars(byte[] bytes)
Deprecated. 

This method was intended to be the inverse of the Unicode character to byte conversion algorithm specified in PKCS12. However, it does not chop off the terminating null bytes resulting from the conversion from chars to bytes as explained in section B.1 of PKCS #12.

This method is only used to convert the initial 512 bytes of a key file into a pseudo-Unicode character array which is then used as a password.


TrueZIP 6.8.3

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