Прочитај на енглеском Уреди

Делите путем


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.

C#
[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();
C#
public ECDiffieHellmanOpenSsl();
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

.NET 10 и друге верзије
Производ Верзије
.NET 6, 7, 8, 9, 10

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.

C#
[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);
C#
public ECDiffieHellmanOpenSsl(int keySize);

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

.NET 10 и друге верзије
Производ Верзије
.NET 6, 7, 8, 9, 10

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*.

C#
[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);
C#
public ECDiffieHellmanOpenSsl(IntPtr handle);

Parameters

handle
IntPtr

The OpenSSL EC_KEY* value to use as the key.

Attributes

Exceptions

handle is Zero.

handle is not a valid EC_KEY*.

Remarks

Важно

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

.NET 10 и друге верзије
Производ Верзије
.NET 6, 7, 8, 9, 10

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.

C#
[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);
C#
public ECDiffieHellmanOpenSsl(System.Security.Cryptography.ECCurve curve);

Parameters

curve
ECCurve

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

Attributes

Exceptions

curve does not validate.

See also

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 6, 7, 8, 9, 10

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*.

C#
[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);
C#
public ECDiffieHellmanOpenSsl(System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle);

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

Важно

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

.NET 10 и друге верзије
Производ Верзије
.NET 6, 7, 8, 9, 10