ECDiffieHellmanOpenSsl Constructors

Definition

Overloads

ECDiffieHellmanOpenSsl()

Initializes a new instance of the ECDiffieHellmanOpenSsl class with a default curve of NIST P-521/secp521r1.

ECDiffieHellmanOpenSsl(Int32)

Initializes a new instance of the ECDiffieHellmanOpenSsl class defaulting to the NIST prime curve of the specified size.

ECDiffieHellmanOpenSsl(IntPtr)

Initializes a new instance of the ECDiffieHellmanOpenSsl class from an existing OpenSSL key represented as an EC_KEY*.

ECDiffieHellmanOpenSsl(ECCurve)

Initializes a new instance of the ECDiffieHellmanOpenSsl class and generates a new key on the specified curve.

ECDiffieHellmanOpenSsl(SafeEvpPKeyHandle)

Initializes a new instance of the ECDiffieHellmanOpenSsl class from an existing OpenSSL key represented as an EVP_PKEY*.

ECDiffieHellmanOpenSsl()

Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs

Initializes a new instance of the ECDiffieHellmanOpenSsl class with a default curve of NIST P-521/secp521r1.

public:
 ECDiffieHellmanOpenSsl();
public ECDiffieHellmanOpenSsl ();
[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 ECDiffieHellmanOpenSsl ();
Public Sub New ()
Attributes

Remarks

This constructor does not generate a new public/private keypair immediately, it just sets the size which will be used to generate a key when one is needed. If key is loaded via the ImportParameters method, or other key import method, the key size from this constructor has no meaning.

See also

Applies to

ECDiffieHellmanOpenSsl(Int32)

Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs

Initializes a new instance of the ECDiffieHellmanOpenSsl class defaulting to the NIST prime curve of the specified size.

public:
 ECDiffieHellmanOpenSsl(int keySize);
public ECDiffieHellmanOpenSsl (int keySize);
[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 ECDiffieHellmanOpenSsl (int keySize);
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : int -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
[<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")>]
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : int -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
Public Sub New (keySize As Integer)

Parameters

keySize
Int32

The size of the key to generate, when a key is needed.

Attributes

Exceptions

The keySize value is not supported by this implementation.

Remarks

Only three key sizes are supported by this constructor: 256 (NIST P-256/secp256r1), 384 (NIST P-384/secp384r1), and 521 (NIST P-521/secp521r1). To generate keys For any other curve, use the ECDiffieHellmanOpenSsl(ECCurve) constructor or the GenerateKey(ECCurve) method.

This constructor does not generate a new public/private keypair immediately, it just sets the size which will be used to generate a key when one is needed. If key is loaded via the ImportParameters method, or other key import method, the key size from this constructor has no meaning.

See also

Applies to

ECDiffieHellmanOpenSsl(IntPtr)

Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs

Initializes a new instance of the ECDiffieHellmanOpenSsl class from an existing OpenSSL key represented as an EC_KEY*.

public:
 ECDiffieHellmanOpenSsl(IntPtr handle);
public ECDiffieHellmanOpenSsl (IntPtr handle);
[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 ECDiffieHellmanOpenSsl (IntPtr handle);
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : nativeint -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
[<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")>]
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : nativeint -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
Public Sub New (handle As IntPtr)

Parameters

handle
IntPtr

nativeint

The OpenSSL EC_KEY* value to use as the key.

Attributes

Exceptions

handle is Zero.

handle is not a valid EC_KEY*.

Remarks

Important

OpenSSL supports multiple library versions being loaded within the same process. Before calling this constructor, verify your pointer value came from the same version of OpenSSL that this class uses. For more information, see OpenSslVersion.

See also

Applies to

ECDiffieHellmanOpenSsl(ECCurve)

Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs

Initializes a new instance of the ECDiffieHellmanOpenSsl class and generates a new key on the specified curve.

public:
 ECDiffieHellmanOpenSsl(System::Security::Cryptography::ECCurve curve);
public ECDiffieHellmanOpenSsl (System.Security.Cryptography.ECCurve curve);
[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 ECDiffieHellmanOpenSsl (System.Security.Cryptography.ECCurve curve);
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
[<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")>]
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : System.Security.Cryptography.ECCurve -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
Public Sub New (curve As ECCurve)

Parameters

curve
ECCurve

The curve used to generate an ephemeral public/private key pair.

Attributes

Exceptions

curve does not validate.

See also

Applies to

ECDiffieHellmanOpenSsl(SafeEvpPKeyHandle)

Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs
Source:
ECDiffieHellmanOpenSsl.cs

Initializes a new instance of the ECDiffieHellmanOpenSsl class from an existing OpenSSL key represented as an EVP_PKEY*.

public:
 ECDiffieHellmanOpenSsl(System::Security::Cryptography::SafeEvpPKeyHandle ^ pkeyHandle);
public ECDiffieHellmanOpenSsl (System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle);
[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 ECDiffieHellmanOpenSsl (System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle);
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
[<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")>]
new System.Security.Cryptography.ECDiffieHellmanOpenSsl : System.Security.Cryptography.SafeEvpPKeyHandle -> System.Security.Cryptography.ECDiffieHellmanOpenSsl
Public Sub New (pkeyHandle As SafeEvpPKeyHandle)

Parameters

pkeyHandle
SafeEvpPKeyHandle

The OpenSSL EVP_PKEY* value to use as the key, represented as a SafeEvpPKeyHandle.

Attributes

Exceptions

pkeyHandle represents an invalid handle.

pkeyHandle is null.

pkeyHandle does not represent a elliptic curve (EC) key.

Remarks

Important

OpenSSL supports multiple library versions being loaded within the same process. Before calling this constructor, verify your pointer value came from the same version of OpenSSL that this class uses. For more information, see OpenSslVersion.

See also

Applies to