org.openpermis.editor.policy.view.keystore
Class KeyStoreReader

java.lang.Object
  extended by org.openpermis.editor.policy.view.keystore.KeyStoreReader
Direct Known Subclasses:
P12KeyStoreReader, SCKeyStoreReader

public abstract class KeyStoreReader
extends Object

Simplifies the communication with a keystore.

Since:
0.9.0

Field Summary
protected static int PASSWORD_FIELD_COLUMNS
           
 
Constructor Summary
KeyStoreReader(ApplicationContext context)
          Creates a KeyStoreReader.
 
Method Summary
protected abstract  void createKeystore()
           
abstract  Enumeration<String> getAliases()
          Returns the keystore aliases.
 X509Certificate getCertificate(String alias)
          Returns a X509Certificate in this key store.
 ApplicationContext getContext()
           
protected  KeyStore getKeyStore()
           
 Component getParent()
           
 PrivateKey getPrivateKey(String alias)
          Returns a PrivateKey isn this key store.
 PrivateKey getPrivateKey(String alias, char[] password)
          Returns a PrivateKey isn this key store.
 void resetKeystore()
          Resets the keystore.
protected  void setKeyStore(KeyStore keyStore)
           
 void setParent(Component parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSWORD_FIELD_COLUMNS

protected static final int PASSWORD_FIELD_COLUMNS
Constant Field Value:
10
Since:
0.9.0
Constructor Detail

KeyStoreReader

public KeyStoreReader(ApplicationContext context)
Creates a KeyStoreReader.

Parameters:
context - the ApplicationContext.
Since:
0.9.0
Method Detail

createKeystore

protected abstract void createKeystore()
                                throws KeyStoreReaderException
Throws:
KeyStoreReaderException
Since:
0.9.0

getAliases

public abstract Enumeration<String> getAliases()
                                        throws KeyStoreReaderException,
                                               KeyStoreException
Returns the keystore aliases.

Returns:
the aliases.
Throws:
KeyStoreReaderException - if there is a problem opening the Keystore.
KeyStoreException - if there is a problem opening the Keystore.
Since:
0.9.0

getPrivateKey

public PrivateKey getPrivateKey(String alias,
                                char[] password)
Returns a PrivateKey isn this key store.

Parameters:
alias - the alias of the PrivateKey.
password - the password of the PrivateKey.
Returns:
a PrivateKey in this key store.
Since:
new

getContext

public ApplicationContext getContext()
Returns:
the context.
Since:
0.9.0

getPrivateKey

public PrivateKey getPrivateKey(String alias)
Returns a PrivateKey isn this key store.

Parameters:
alias - the alias of the PrivateKey.
Returns:
a PrivateKey in this key store.
Since:
new

getCertificate

public X509Certificate getCertificate(String alias)
Returns a X509Certificate in this key store.

Parameters:
alias - the alias of the certificate.
Returns:
a X509Certificate.
Since:
0.9.0

getKeyStore

protected KeyStore getKeyStore()
                        throws KeyStoreReaderException
Throws:
KeyStoreReaderException
Since:
0.9.0

setKeyStore

protected void setKeyStore(KeyStore keyStore)
Parameters:
keyStore - the keyStore to set.
Since:
0.9.0

getParent

public Component getParent()
Returns:
the parent.
Since:
0.9.0

setParent

public void setParent(Component parent)
Parameters:
parent - the parent to set.
Since:
0.9.0

resetKeystore

public void resetKeystore()
Resets the keystore.

Since:
0.9.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG