jPod PDF library

de.intarsys.pdf.crypt
Class PasswordProvider

java.lang.Object
  extended by de.intarsys.pdf.crypt.PasswordProvider

public class PasswordProvider
extends Object

A VM singleton for the PDF related IPasswordProvider.

Using this factory one can implement different strategies for the IAuthenticationHandler to receive its passwords.

First, a password attached to the document itself (via the options when opening) can be looked up.
Second, an IPasswordProvider attached to the document itself (via the options when opening) can be looked up.
Third, a global IPasswordProvider attached to the current thread can be looked up.
Fourth, a globally unique IPasswordProvider can be looked up.

While an ISecurityHandler or IAuthenticationHandler does not need to use these features, the standard implementations do.


Field Summary
static String ATTR_PASSWORD
           
static String ATTR_PASSWORDPROVIDER
           
 
Method Summary
static de.intarsys.tools.authenticate.IPasswordProvider get()
          Return the unique factory.
static char[] getPassword(STDocument doc)
           
static de.intarsys.tools.authenticate.IPasswordProvider getPasswordProvider(STDocument doc)
           
static void set(de.intarsys.tools.authenticate.IPasswordProvider unique)
          Set the unique factory.
static void setPassword(Map options, char[] password)
           
static void setPasswordProvider(Map options, de.intarsys.tools.authenticate.IPasswordProvider passwordProvider)
           
static void setThreadLocal(de.intarsys.tools.authenticate.IPasswordProvider passwordProvider)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_PASSWORD

public static final String ATTR_PASSWORD
See Also:
Constant Field Values

ATTR_PASSWORDPROVIDER

public static final String ATTR_PASSWORDPROVIDER
See Also:
Constant Field Values
Method Detail

get

public static de.intarsys.tools.authenticate.IPasswordProvider get()
Return the unique factory.

Returns:
Return the unique factory.

getPassword

public static char[] getPassword(STDocument doc)

getPasswordProvider

public static de.intarsys.tools.authenticate.IPasswordProvider getPasswordProvider(STDocument doc)

set

public static void set(de.intarsys.tools.authenticate.IPasswordProvider unique)
Set the unique factory.

Parameters:
unique - The new unique factory.

setPassword

public static void setPassword(Map options,
                               char[] password)

setPasswordProvider

public static void setPasswordProvider(Map options,
                                       de.intarsys.tools.authenticate.IPasswordProvider passwordProvider)

setThreadLocal

public static void setThreadLocal(de.intarsys.tools.authenticate.IPasswordProvider passwordProvider)

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.