KeyStore.Builder.NewInstance Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| NewInstance(File, KeyStore+IProtectionParameter) |
Returns a new Builder object. |
| NewInstance(KeyStore, KeyStore+IProtectionParameter) |
Returns a new |
| NewInstance(String, Provider, KeyStore+IProtectionParameter) |
Returns a new |
| NewInstance(String, Provider, File, KeyStore+IProtectionParameter) |
Returns a new |
NewInstance(File, KeyStore+IProtectionParameter)
Returns a new Builder object.
[Android.Runtime.Register("newInstance", "(Ljava/io/File;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "", ApiSince=33)]
public static Java.Security.KeyStore.Builder NewInstance(Java.IO.File file, Java.Security.KeyStore.IProtectionParameter protection);
[<Android.Runtime.Register("newInstance", "(Ljava/io/File;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "", ApiSince=33)>]
static member NewInstance : Java.IO.File * Java.Security.KeyStore.IProtectionParameter -> Java.Security.KeyStore.Builder
Parameters
- file
- File
the File that contains the KeyStore data
- protection
- KeyStore.IProtectionParameter
the ProtectionParameter securing the KeyStore data
Returns
a new Builder object
- Attributes
Remarks
Returns a new Builder object. The first call to the getKeyStore() method on the returned builder will create a KeyStore using file to detect the keystore type and then call its load() method. It uses the same algorithm to determine the keystore type as described in KeyStore.getInstance(File, LoadStoreParameter). The inputStream argument is constructed from file. If protection is a PasswordProtection, the password is obtained by calling the getPassword method. Otherwise, if protection is a CallbackHandlerProtection, the password is obtained by invoking the CallbackHandler. Subsequent calls to getKeyStore() return the same object as the initial call. If the initial call failed with a KeyStoreException, subsequent calls also throw a KeyStoreException. Calls to getProtectionParameter() will return a PasswordProtection object encapsulating the password that was used to invoke the load method. Note that the getKeyStore() method is executed within the AccessControlContext of the code invoking this method.
Java reference for java.security.KeyStore.Builder.newInstance.
Applies to
NewInstance(KeyStore, KeyStore+IProtectionParameter)
Returns a new Builder that holds the given KeyStore
and the given ProtectionParameter.
[Android.Runtime.Register("newInstance", "(Ljava/security/KeyStore;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")]
public static Java.Security.KeyStore.Builder NewInstance(Java.Security.KeyStore keyStore, Java.Security.KeyStore.IProtectionParameter protectionParameter);
[<Android.Runtime.Register("newInstance", "(Ljava/security/KeyStore;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")>]
static member NewInstance : Java.Security.KeyStore * Java.Security.KeyStore.IProtectionParameter -> Java.Security.KeyStore.Builder
Parameters
- keyStore
- KeyStore
the KeyStore to be held.
- protectionParameter
- KeyStore.IProtectionParameter
the ProtectionParameter to be held.
Returns
a new Builder object
- Attributes
Exceptions
if keyStore or protectionParameter is
null.
if the given KeyStore is not initialized.
Remarks
Returns a new Builder that encapsulates the given KeyStore. The getKeyStore() method of the returned object will return keyStore, the getProtectionParameter() method will return protectionParameters. This is useful if an existing KeyStore object needs to be used with builder-based APIs.
Java reference for java.security.KeyStore.Builder.newInstance.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewInstance(String, Provider, KeyStore+IProtectionParameter)
Returns a new Builder that creates a new KeyStore
based on the provided arguments.
[Android.Runtime.Register("newInstance", "(Ljava/lang/String;Ljava/security/Provider;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")]
public static Java.Security.KeyStore.Builder NewInstance(string type, Java.Security.Provider provider, Java.Security.KeyStore.IProtectionParameter protection);
[<Android.Runtime.Register("newInstance", "(Ljava/lang/String;Ljava/security/Provider;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")>]
static member NewInstance : string * Java.Security.Provider * Java.Security.KeyStore.IProtectionParameter -> Java.Security.KeyStore.Builder
Parameters
- type
- String
the type of the KeyStore to be constructed.
- provider
- Provider
the provider of the KeyStore to be constructed,
maybe null.
- protection
- KeyStore.IProtectionParameter
the ProtectionParameter securing the Keystore
Returns
a new Builder object
- Attributes
Exceptions
if type or protectionParameter is null.
protectionParameter not an instance of either
PasswordProtection or CallbackHandlerProtection, file is not a file or
does not exist at all.
Remarks
Returns a new Builder object. Each call to the getKeyStore() method on the returned builder will return a new KeyStore object of type type. Its load() method is invoked using a LoadStoreParameter that encapsulates protection. The KeyStore is instantiated from provider if non-null. Otherwise, all installed providers are searched. Calls to getProtectionParameter() will return protection. Note that the getKeyStore() method is executed within the AccessControlContext of the code invoking this method.
Java reference for java.security.KeyStore.Builder.newInstance.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
NewInstance(String, Provider, File, KeyStore+IProtectionParameter)
Returns a new Builder that creates a new KeyStore
based on the provided arguments.
[Android.Runtime.Register("newInstance", "(Ljava/lang/String;Ljava/security/Provider;Ljava/io/File;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")]
public static Java.Security.KeyStore.Builder NewInstance(string type, Java.Security.Provider provider, Java.IO.File file, Java.Security.KeyStore.IProtectionParameter protection);
[<Android.Runtime.Register("newInstance", "(Ljava/lang/String;Ljava/security/Provider;Ljava/io/File;Ljava/security/KeyStore$ProtectionParameter;)Ljava/security/KeyStore$Builder;", "")>]
static member NewInstance : string * Java.Security.Provider * Java.IO.File * Java.Security.KeyStore.IProtectionParameter -> Java.Security.KeyStore.Builder
Parameters
- type
- String
the type of the KeyStore to be constructed.
- provider
- Provider
the provider of the KeyStore to be constructed,
maybe null.
- file
- File
the File that contains the data for the KeyStore.
- protection
- KeyStore.IProtectionParameter
the ProtectionParameter securing the KeyStore data
Returns
a new Builder object
- Attributes
Exceptions
if type, protectionParameter or file is
null.
protectionParameter not an instance of either
PasswordProtection or CallbackHandlerProtection, file is not a file or
does not exist at all.
Remarks
Returns a new Builder object. The first call to the getKeyStore() method on the returned builder will create a KeyStore of type type and call its load() method. The inputStream argument is constructed from file. If protection is a PasswordProtection, the password is obtained by calling the getPassword method. Otherwise, if protection is a CallbackHandlerProtection, the password is obtained by invoking the CallbackHandler. Subsequent calls to getKeyStore() return the same object as the initial call. If the initial call failed with a KeyStoreException, subsequent calls also throw a KeyStoreException. The KeyStore is instantiated from provider if non-null. Otherwise, all installed providers are searched. Calls to getProtectionParameter() will return a PasswordProtection object encapsulating the password that was used to invoke the load method. Note that the getKeyStore() method is executed within the AccessControlContext of the code invoking this method.
Java reference for java.security.KeyStore.Builder.newInstance.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.