org.eparapher.core.crypto.keystore
Class GenericKeystore

java.lang.Object
  extended by org.eparapher.core.crypto.keystore.GenericKeystore
All Implemented Interfaces:
IGenericStore, IUserKeystore
Direct Known Subclasses:
FileKeystore, HardwareKeyStore, MSCAPIKeystore

public abstract class GenericKeystore
extends Object
implements IUserKeystore


Field Summary
protected  String currentalias
           
protected  boolean currentaliasselected
           
protected  PrivateKey currentPrivateKey
           
protected  PublicKey currentPublicKey
           
protected  X509Certificate currentX509Certificate
           
protected  X509Certificate[] currentX509CertificateChain
           
protected  KeyStore ks
           
protected  boolean loadedKeystore
           
 
Constructor Summary
protected GenericKeystore()
           
 
Method Summary
protected  boolean autoSelectAlias()
           
 boolean containsAlias(String alias)
          Return true if alias already define in the keystore
 String getDefaultAlias()
           
 KeyStore getKeystore()
           
 KeystoreEntry[] getKeystoreEntries()
           
 PrivateKey getPrivateKey()
           
 String getProviderName()
           
 PublicKey getPublicKey()
           
 Set<TrustAnchor> getTrustAnchors()
           
 KeystoreEntry[] getTrustedCertificates()
           
 X509Certificate getX509Certificate()
           
 X509Certificate[] getX509CertificateChain()
           
 boolean isKeystoreLoaded()
           
 boolean loadPrivateKey(String secret)
           
 boolean loadPublicInformation()
          Load Public key and certificate on the selected/default alias
 boolean newcertificate()
           
protected  boolean selectAlias()
           
 boolean setDefaultAlias(String alias)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eparapher.core.crypto.keystore.IUserKeystore
exists, initialize
 
Methods inherited from interface org.eparapher.core.crypto.keystore.IGenericStore
loadKeyStore, loadKeyStore, loadPrivateKey, saveKeyStore
 

Field Detail

currentPrivateKey

protected PrivateKey currentPrivateKey

currentPublicKey

protected PublicKey currentPublicKey

currentX509Certificate

protected X509Certificate currentX509Certificate

currentX509CertificateChain

protected X509Certificate[] currentX509CertificateChain

currentalias

protected String currentalias

currentaliasselected

protected boolean currentaliasselected

ks

protected KeyStore ks

loadedKeystore

protected boolean loadedKeystore
Constructor Detail

GenericKeystore

protected GenericKeystore()
Method Detail

isKeystoreLoaded

public boolean isKeystoreLoaded()

getKeystoreEntries

public KeystoreEntry[] getKeystoreEntries()
Specified by:
getKeystoreEntries in interface IUserKeystore

getTrustedCertificates

public KeystoreEntry[] getTrustedCertificates()

loadPublicInformation

public boolean loadPublicInformation()
Load Public key and certificate on the selected/default alias

Specified by:
loadPublicInformation in interface IGenericStore
Returns:
true if public key and X509 certificate(s) loaded

loadPrivateKey

public boolean loadPrivateKey(String secret)
Specified by:
loadPrivateKey in interface IGenericStore
Parameters:
ALIAS -
PINorPWD -
Returns:

selectAlias

protected boolean selectAlias()

autoSelectAlias

protected boolean autoSelectAlias()

setDefaultAlias

public boolean setDefaultAlias(String alias)
Specified by:
setDefaultAlias in interface IUserKeystore

getDefaultAlias

public String getDefaultAlias()
Specified by:
getDefaultAlias in interface IUserKeystore

containsAlias

public boolean containsAlias(String alias)
Return true if alias already define in the keystore

Specified by:
containsAlias in interface IGenericStore

getPrivateKey

public PrivateKey getPrivateKey()
Specified by:
getPrivateKey in interface IUserKeystore

getPublicKey

public PublicKey getPublicKey()
Specified by:
getPublicKey in interface IUserKeystore

getX509Certificate

public X509Certificate getX509Certificate()
Specified by:
getX509Certificate in interface IUserKeystore

getX509CertificateChain

public X509Certificate[] getX509CertificateChain()
Specified by:
getX509CertificateChain in interface IUserKeystore

getProviderName

public String getProviderName()
Specified by:
getProviderName in interface IGenericStore

getKeystore

public KeyStore getKeystore()
Specified by:
getKeystore in interface IGenericStore

newcertificate

public boolean newcertificate()
Specified by:
newcertificate in interface IGenericStore

getTrustAnchors

public Set<TrustAnchor> getTrustAnchors()
Specified by:
getTrustAnchors in interface IGenericStore


Copyright © 2009 eParapher Software Foundation. All Rights Reserved.