Edit

Share via


SafeEvpPKeyHandle.OpenKeyFromProvider(String, String) Method

Definition

Opens a named key using a named OSSL_PROVIDER.

public:
 static System::Security::Cryptography::SafeEvpPKeyHandle ^ OpenKeyFromProvider(System::String ^ providerName, System::String ^ keyUri);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("windows")]
public static System.Security.Cryptography.SafeEvpPKeyHandle OpenKeyFromProvider (string providerName, string keyUri);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("windows")>]
static member OpenKeyFromProvider : string * string -> System.Security.Cryptography.SafeEvpPKeyHandle
Public Shared Function OpenKeyFromProvider (providerName As String, keyUri As String) As SafeEvpPKeyHandle

Parameters

providerName
String

The name of the OSSL_PROVIDER to process the key open request.

keyUri
String

The URI assigned by the OSSL_PROVIDER of the key to open.

Returns

The opened key.

Attributes

Exceptions

providerName or keyUri is null.

providerName or keyUri is the empty string.

The current platform does not support OpenSSL Providers.

The key could not be opened via the specified named OSSL_PROVIDER.

Remarks

Both providerName and keyUri must be trusted inputs.

This operation will fail if OpenSSL cannot successfully load the named OSSL_PROVIDER, or if the named OSSL_PROVIDER cannot load the named key.

The syntax for keyUri is determined by each individual named OSSL_PROVIDER.

Applies to