Build 1.0_r1(from source)

java.security
Class KeyStore

java.lang.Object
  extended by java.security.KeyStore

public class KeyStore
extends Object


Nested Class Summary
static class KeyStore.Builder
           
static class KeyStore.CallbackHandlerProtection
           
static interface KeyStore.Entry
           
static interface KeyStore.LoadStoreParameter
           
static class KeyStore.PasswordProtection
           
static class KeyStore.PrivateKeyEntry
           
static interface KeyStore.ProtectionParameter
           
static class KeyStore.SecretKeyEntry
           
static class KeyStore.TrustedCertificateEntry
           
 
Constructor Summary
protected KeyStore(KeyStoreSpi keyStoreSpi, Provider provider, String type)
           
 
Method Summary
 Enumeration<String> aliases()
           
 boolean containsAlias(String alias)
          1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null
 void deleteEntry(String alias)
          1.4.2 and 1.5 releases throw NullPointerException when alias is null
 boolean entryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass)
           
 Certificate getCertificate(String alias)
           
 String getCertificateAlias(Certificate cert)
           
 Certificate[] getCertificateChain(String alias)
           
 Date getCreationDate(String alias)
           
static String getDefaultType()
           
 KeyStore.Entry getEntry(String alias, KeyStore.ProtectionParameter param)
           
static KeyStore getInstance(String type)
           
static KeyStore getInstance(String type, Provider provider)
          throws NullPointerException if type is null (instead of NoSuchAlgorithmException) as in 1.4 release
static KeyStore getInstance(String type, String provider)
           
 Key getKey(String alias, char[] password)
           
 Provider getProvider()
           
 String getType()
           
 boolean isCertificateEntry(String alias)
          jdk1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null
 boolean isKeyEntry(String alias)
          jdk1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null
 void load(InputStream stream, char[] password)
           
 void load(KeyStore.LoadStoreParameter param)
           
 void setCertificateEntry(String alias, Certificate cert)
          1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null
 void setEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter param)
          1.5 release throws unspecified NullPointerException when alias or entry is null
 void setKeyEntry(String alias, byte[] key, Certificate[] chain)
           
 void setKeyEntry(String alias, Key key, char[] password, Certificate[] chain)
          1.4.2 and 1.5 releases throw unspecified NullPointerException - when alias is null IllegalArgumentException - when password is null IllegalArgumentException - when key is instance of PrivateKey and chain is null or empty
 int size()
           
 void store(KeyStore.LoadStoreParameter param)
           
 void store(OutputStream stream, char[] password)
          throws IOException when stream or password is null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStore

protected KeyStore(KeyStoreSpi keyStoreSpi,
                   Provider provider,
                   String type)
Method Detail

getInstance

public static KeyStore getInstance(String type)
                            throws KeyStoreException
Throws:
NullPointerException - if type is null
KeyStoreException

getInstance

public static KeyStore getInstance(String type,
                                   String provider)
                            throws KeyStoreException,
                                   NoSuchProviderException
Throws:
NullPointerException - if type is null (instead of NoSuchAlgorithmException) as in 1.4 release
KeyStoreException
NoSuchProviderException

getInstance

public static KeyStore getInstance(String type,
                                   Provider provider)
                            throws KeyStoreException
throws NullPointerException if type is null (instead of NoSuchAlgorithmException) as in 1.4 release

Throws:
KeyStoreException

getDefaultType

public static final String getDefaultType()

getProvider

public final Provider getProvider()

getType

public final String getType()

getKey

public final Key getKey(String alias,
                        char[] password)
                 throws KeyStoreException,
                        NoSuchAlgorithmException,
                        UnrecoverableKeyException
Throws:
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException

getCertificateChain

public final Certificate[] getCertificateChain(String alias)
                                        throws KeyStoreException
Throws:
KeyStoreException

getCertificate

public final Certificate getCertificate(String alias)
                                 throws KeyStoreException
Throws:
KeyStoreException

getCreationDate

public final Date getCreationDate(String alias)
                           throws KeyStoreException
Throws:
KeyStoreException

setKeyEntry

public final void setKeyEntry(String alias,
                              Key key,
                              char[] password,
                              Certificate[] chain)
                       throws KeyStoreException
1.4.2 and 1.5 releases throw unspecified NullPointerException - when alias is null IllegalArgumentException - when password is null IllegalArgumentException - when key is instance of PrivateKey and chain is null or empty

Throws:
KeyStoreException

setKeyEntry

public final void setKeyEntry(String alias,
                              byte[] key,
                              Certificate[] chain)
                       throws KeyStoreException
Throws:
KeyStoreException

setCertificateEntry

public final void setCertificateEntry(String alias,
                                      Certificate cert)
                               throws KeyStoreException
1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null

Throws:
KeyStoreException

deleteEntry

public final void deleteEntry(String alias)
                       throws KeyStoreException
1.4.2 and 1.5 releases throw NullPointerException when alias is null

Throws:
KeyStoreException

aliases

public final Enumeration<String> aliases()
                                  throws KeyStoreException
Throws:
KeyStoreException

containsAlias

public final boolean containsAlias(String alias)
                            throws KeyStoreException
1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null

Throws:
KeyStoreException

size

public final int size()
               throws KeyStoreException
Throws:
KeyStoreException

isKeyEntry

public final boolean isKeyEntry(String alias)
                         throws KeyStoreException
jdk1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null

Throws:
KeyStoreException

isCertificateEntry

public final boolean isCertificateEntry(String alias)
                                 throws KeyStoreException
jdk1.4.2 and 1.5 releases throw unspecified NullPointerException when alias is null

Throws:
KeyStoreException

getCertificateAlias

public final String getCertificateAlias(Certificate cert)
                                 throws KeyStoreException
Throws:
KeyStoreException

store

public final void store(OutputStream stream,
                        char[] password)
                 throws KeyStoreException,
                        IOException,
                        NoSuchAlgorithmException,
                        CertificateException
throws IOException when stream or password is null

Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

store

public final void store(KeyStore.LoadStoreParameter param)
                 throws KeyStoreException,
                        IOException,
                        NoSuchAlgorithmException,
                        CertificateException
Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

load

public final void load(InputStream stream,
                       char[] password)
                throws IOException,
                       NoSuchAlgorithmException,
                       CertificateException
Throws:
IOException
NoSuchAlgorithmException
CertificateException

load

public final void load(KeyStore.LoadStoreParameter param)
                throws IOException,
                       NoSuchAlgorithmException,
                       CertificateException
Throws:
IOException
NoSuchAlgorithmException
CertificateException

getEntry

public final KeyStore.Entry getEntry(String alias,
                                     KeyStore.ProtectionParameter param)
                              throws NoSuchAlgorithmException,
                                     UnrecoverableEntryException,
                                     KeyStoreException
Throws:
NoSuchAlgorithmException
UnrecoverableEntryException
KeyStoreException

setEntry

public final void setEntry(String alias,
                           KeyStore.Entry entry,
                           KeyStore.ProtectionParameter param)
                    throws KeyStoreException
1.5 release throws unspecified NullPointerException when alias or entry is null

Throws:
KeyStoreException

entryInstanceOf

public final boolean entryInstanceOf(String alias,
                                     Class<? extends KeyStore.Entry> entryClass)
                              throws KeyStoreException
Throws:
KeyStoreException

Build 1.0_r1(from source)

Please submit a feedback, bug or feature