/[classpath]/classpath/java/security/KeyStore.java
ViewVC logotype

Diff of /classpath/java/security/KeyStore.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Tue Jan 22 22:27:00 2002 UTC revision 1.5 by tromey, Mon Nov 18 18:04:38 2002 UTC
# Line 1  Line 1 
1  /* KeyStore.java --- Key Store Class  /* KeyStore.java --- Key Store Class
2     Copyright (C) 1999 Free Software Foundation, Inc.     Copyright (C) 1999, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 92  public class KeyStore Line 92  public class KeyStore
92    /**    /**
93       Gets an instance of the KeyStore class representing       Gets an instance of the KeyStore class representing
94       the specified keystore. If the type is not       the specified keystore. If the type is not
95       found then, it throws CertificateException.       found then, it throws KeyStoreException.
96    
97       @param type the type of certificate to choose       @param type the type of keystore to choose
98    
99       @return a KeyStore repesenting the desired type       @return a KeyStore repesenting the desired type
100    
# Line 117  public class KeyStore Line 117  public class KeyStore
117    /**    /**
118       Gets an instance of the KeyStore class representing       Gets an instance of the KeyStore class representing
119       the specified key store from the specified provider.       the specified key store from the specified provider.
120       If the type is not found then, it throws CertificateException.       If the type is not found then, it throws KeyStoreException.
121       If the provider is not found, then it throws       If the provider is not found, then it throws
122       NoSuchProviderException.       NoSuchProviderException.
123    
124       @param type the type of certificate to choose       @param type the type of keystore to choose
125         @param provider the provider name
126    
127       @return a KeyStore repesenting the desired type       @return a KeyStore repesenting the desired type
128    
129       @throws KeyStoreException if the type of keystore is not implemented by providers       @throws KeyStoreException if the type of keystore is not
130                  implemented by the given provider
131       @throws NoSuchProviderException if the provider is not found       @throws NoSuchProviderException if the provider is not found
132         @throws IllegalArgumentException if the provider string is
133                   null or empty
134     */     */
135    public static KeyStore getInstance(String type, String provider)    public static KeyStore getInstance(String type, String provider)
136      throws KeyStoreException, NoSuchProviderException      throws KeyStoreException, NoSuchProviderException
137    {    {
138        if (provider == null || provider.length() == 0)
139          throw new IllegalArgumentException("Illegal provider");
140      Provider p = Security.getProvider(provider);      Provider p = Security.getProvider(provider);
141      if (p == null)      if (p == null)
142        throw new NoSuchProviderException();        throw new NoSuchProviderException();
# Line 138  public class KeyStore Line 144  public class KeyStore
144      return getInstance(p.getProperty("KeyStore." + type), type, p);      return getInstance(p.getProperty("KeyStore." + type), type, p);
145    }    }
146    
147      /**
148         Gets an instance of the KeyStore class representing
149         the specified key store from the specified provider.
150         If the type is not found then, it throws KeyStoreException.
151         If the provider is not found, then it throws
152         NoSuchProviderException.
153    
154         @param type the type of keystore to choose
155         @param provider the keystore provider
156    
157         @return a KeyStore repesenting the desired type
158    
159         @throws KeyStoreException if the type of keystore is not
160                  implemented by the given provider
161         @throws IllegalArgumentException if the provider object is null
162         @since 1.4
163       */
164      public static KeyStore getInstance(String type, Provider provider)
165        throws KeyStoreException
166      {
167        if (provider == null)
168          throw new IllegalArgumentException("Illegal provider");
169    
170        return getInstance(provider.getProperty("KeyStore." + type),
171                           type, provider);
172      }
173    
174    private static KeyStore getInstance(String classname,    private static KeyStore getInstance(String classname,
175                                        String type,                                        String type,
176                                        Provider provider)                                        Provider provider)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26