Edit

Share via


SafeEvpPKeyHandle.DuplicateHandle Method

Definition

Creates another instance of this type which has an independent lifetime but tracks the same resource.

public:
 System::Security::Cryptography::SafeEvpPKeyHandle ^ DuplicateHandle();
public System.Security.Cryptography.SafeEvpPKeyHandle DuplicateHandle();
member this.DuplicateHandle : unit -> System.Security.Cryptography.SafeEvpPKeyHandle
Public Function DuplicateHandle () As SafeEvpPKeyHandle

Returns

Another instance of this type which has an independent lifetime but tracks the same resource.

Exceptions

This handle is invalid.

Remarks

In .NET 8 and earlier versions, this method creates a new EVP_PKEY instance. In .NET 9 and later versions, this method increments the reference count of the existing EVP_PKEY instance and returns a handle to the same key.

Applies to

See also