< prev index next >

src/java.base/share/classes/java/security/KeyStore.java

Print this page




 959      * Returns the default keystore type as specified by the
 960      * {@code keystore.type} security property, or the string
 961      * {@literal "jks"} (acronym for {@literal "Java keystore"})
 962      * if no such property exists.
 963      *
 964      * <p>The default keystore type can be used by applications that do not
 965      * want to use a hard-coded keystore type when calling one of the
 966      * {@code getInstance} methods, and want to provide a default keystore
 967      * type in case a user does not specify its own.
 968      *
 969      * <p>The default keystore type can be changed by setting the value of the
 970      * {@code keystore.type} security property to the desired keystore type.
 971      *
 972      * @return the default keystore type as specified by the
 973      * {@code keystore.type} security property, or the string {@literal "jks"}
 974      * if no such property exists.
 975      * @see java.security.Security security properties
 976      */
 977     public final static String getDefaultType() {
 978         String kstype;
 979         kstype = AccessController.doPrivileged(new PrivilegedAction<String>() {
 980             public String run() {
 981                 return Security.getProperty(KEYSTORE_TYPE);
 982             }
 983         });
 984         if (kstype == null) {
 985             kstype = "jks";
 986         }
 987         return kstype;
 988     }
 989 
 990     /**
 991      * Returns the provider of this keystore.
 992      *
 993      * @return the provider of this keystore.
 994      */
 995     public final Provider getProvider()
 996     {
 997         return this.provider;
 998     }
 999 




 959      * Returns the default keystore type as specified by the
 960      * {@code keystore.type} security property, or the string
 961      * {@literal "jks"} (acronym for {@literal "Java keystore"})
 962      * if no such property exists.
 963      *
 964      * <p>The default keystore type can be used by applications that do not
 965      * want to use a hard-coded keystore type when calling one of the
 966      * {@code getInstance} methods, and want to provide a default keystore
 967      * type in case a user does not specify its own.
 968      *
 969      * <p>The default keystore type can be changed by setting the value of the
 970      * {@code keystore.type} security property to the desired keystore type.
 971      *
 972      * @return the default keystore type as specified by the
 973      * {@code keystore.type} security property, or the string {@literal "jks"}
 974      * if no such property exists.
 975      * @see java.security.Security security properties
 976      */
 977     public final static String getDefaultType() {
 978         String kstype;
 979         kstype = AccessController.doPrivileged(new PrivilegedAction<>() {
 980             public String run() {
 981                 return Security.getProperty(KEYSTORE_TYPE);
 982             }
 983         });
 984         if (kstype == null) {
 985             kstype = "jks";
 986         }
 987         return kstype;
 988     }
 989 
 990     /**
 991      * Returns the provider of this keystore.
 992      *
 993      * @return the provider of this keystore.
 994      */
 995     public final Provider getProvider()
 996     {
 997         return this.provider;
 998     }
 999 


< prev index next >