com.intel.gui.editors.keystore2
Class CredentialStore

java.lang.Object
  extended by com.intel.gui.editors.keystore2.CredentialStore

public class CredentialStore
extends java.lang.Object

The abstraction of credential store that can provide local stored credentials as well as other types of credentials from the VO entities

Author:
aslukich

Constructor Summary
CredentialStore(java.lang.String keystore, java.lang.String type, char[] password, ITableKey accounts, IPreferences prefs)
           
 
Method Summary
 void deleteEntry(java.lang.String alias)
          Delete the specified entry
 com.intel.gpe.security.credstore.Account getAccount(java.lang.String alias)
           
 java.util.List<java.lang.String> getAccountAliases()
           
 java.util.List<java.lang.String> getCertAliases()
          Get the list of certificate type aliases
 java.security.cert.X509Certificate getCertificate(java.lang.String alias)
          Get the certificate associated with the given alias
 java.lang.String getCertificateAlias(java.security.cert.X509Certificate cert)
          Get the alias of the first entry matching the specified certificate.
 java.security.cert.X509Certificate[] getCertificates(java.lang.String alias)
          Get the certificate chain associated with the given alias
 com.intel.gpe.security.Credential getCredential(java.lang.String alias, char[] password)
          Get the credential associated with the alias
 java.util.List<java.lang.String> getKeyAliases()
          Get the list of credstore key entry aliases
 java.util.List<java.security.cert.X509Certificate> getTrustedCertificates()
          Get the list of trusted certificates
 boolean isAccountEntry(java.lang.String alias)
          Check if the specified alias refers an account entry
 boolean isCertEntry(java.lang.String alias)
          Check if the specified alias refers a certificate entry
 boolean isKeyEntry(java.lang.String alias)
          Check if the specified alias corresponds to the key entry
 void putAccount(java.lang.String accountName, com.intel.gpe.security.credstore.Account newAccount)
           
 void putCertificate(java.lang.String alias, java.security.cert.X509Certificate cert)
          Put the certificate into the keystore
 void setCredential(java.lang.String alias, com.intel.gpe.security.Credential credential, char[] password)
          Set the credetial for the alias
 void store(IPreferences prefs)
          Store the keystore in the file and accounts in the registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CredentialStore

public CredentialStore(java.lang.String keystore,
                       java.lang.String type,
                       char[] password,
                       ITableKey accounts,
                       IPreferences prefs)
                throws com.intel.gpe.security.credstore.CredStoreException
Throws:
com.intel.gpe.security.credstore.CredStoreException
Method Detail

store

public void store(IPreferences prefs)
           throws com.intel.gpe.security.credstore.CredStoreException
Store the keystore in the file and accounts in the registry

Throws:
com.intel.gpe.security.credstore.CredStoreException

getCredential

public com.intel.gpe.security.Credential getCredential(java.lang.String alias,
                                                       char[] password)
                                                throws com.intel.gpe.security.credstore.CredStoreException
Get the credential associated with the alias

Parameters:
alias - - the alias
password - - the entry password
Returns:
the credential
Throws:
com.intel.gpe.security.credstore.CredStoreException

setCredential

public void setCredential(java.lang.String alias,
                          com.intel.gpe.security.Credential credential,
                          char[] password)
                   throws com.intel.gpe.security.credstore.CredStoreException
Set the credetial for the alias

Parameters:
alias - - the alias
credential - - the credential
password - - the entry password
Throws:
com.intel.gpe.security.credstore.CredStoreException

getKeyAliases

public java.util.List<java.lang.String> getKeyAliases()
                                               throws com.intel.gpe.security.credstore.CredStoreException
Get the list of credstore key entry aliases

Returns:
the list of key entry aliases
Throws:
com.intel.gpe.security.credstore.CredStoreException
java.security.KeyStoreException

getCertAliases

public java.util.List<java.lang.String> getCertAliases()
                                                throws com.intel.gpe.security.credstore.CredStoreException
Get the list of certificate type aliases

Returns:
the list of certificate type aliases
Throws:
com.intel.gpe.security.credstore.CredStoreException

getCertificate

public java.security.cert.X509Certificate getCertificate(java.lang.String alias)
                                                  throws java.security.cert.CertificateException
Get the certificate associated with the given alias

Parameters:
alias - - the alias
Returns:
the corresponding certificate
Throws:
java.security.cert.CertificateException

getTrustedCertificates

public java.util.List<java.security.cert.X509Certificate> getTrustedCertificates()
                                                                          throws java.security.cert.CertificateException
Get the list of trusted certificates

Returns:
the trusted certificates
Throws:
java.security.cert.CertificateException

getCertificates

public java.security.cert.X509Certificate[] getCertificates(java.lang.String alias)
                                                     throws java.security.cert.CertificateException
Get the certificate chain associated with the given alias

Parameters:
alias - alias
Returns:
the certificate chain
Throws:
java.security.cert.CertificateException

putCertificate

public void putCertificate(java.lang.String alias,
                           java.security.cert.X509Certificate cert)
                    throws java.security.cert.CertificateEncodingException
Put the certificate into the keystore

Parameters:
alias - - the alias
cert - - the certificate
Throws:
java.security.cert.CertificateEncodingException
java.security.KeyStoreException

getCertificateAlias

public java.lang.String getCertificateAlias(java.security.cert.X509Certificate cert)
                                     throws java.security.cert.CertificateException
Get the alias of the first entry matching the specified certificate. If the entry is a trusted certificate entry then its certificate is matched against the parameter, otherwise the first certificate of the key entry chain is matched against.

Parameters:
cert - - the certificate to search
Returns:
the alias of the entry, null if not found
Throws:
java.security.cert.CertificateException

isKeyEntry

public boolean isKeyEntry(java.lang.String alias)
                   throws com.intel.gpe.security.credstore.CredStoreException
Check if the specified alias corresponds to the key entry

Parameters:
alias - - the alias
Returns:
true if the alias refers a key entry
Throws:
com.intel.gpe.security.credstore.CredStoreException

deleteEntry

public void deleteEntry(java.lang.String alias)
                 throws com.intel.gpe.security.credstore.CredStoreException
Delete the specified entry

Parameters:
alias - - the entry alias
Throws:
com.intel.gpe.security.credstore.CredStoreException
java.security.KeyStoreException

isAccountEntry

public boolean isAccountEntry(java.lang.String alias)
Check if the specified alias refers an account entry

Parameters:
alias - - the alias
Returns:
true if the alias refers an account entry

getAccountAliases

public java.util.List<java.lang.String> getAccountAliases()

isCertEntry

public boolean isCertEntry(java.lang.String alias)
                    throws com.intel.gpe.security.credstore.CredStoreException
Check if the specified alias refers a certificate entry

Parameters:
alias - - the alias
Returns:
true if the alias refers a certificate entry
Throws:
com.intel.gpe.security.credstore.CredStoreException

getAccount

public com.intel.gpe.security.credstore.Account getAccount(java.lang.String alias)

putAccount

public void putAccount(java.lang.String accountName,
                       com.intel.gpe.security.credstore.Account newAccount)


Copyright © 2008. All Rights Reserved.