संपादित करें

इसके माध्यम से साझा किया गया


ECDiffieHellman Class

Definition

Provides an abstract base class that Elliptic Curve Diffie-Hellman (ECDH) algorithm implementations can derive from. This class provides the basic set of operations that all ECDH implementations must support.

public ref class ECDiffieHellman abstract : System::Security::Cryptography::AsymmetricAlgorithm
public ref class ECDiffieHellman abstract : System::Security::Cryptography::ECAlgorithm
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public abstract class ECDiffieHellman : System.Security.Cryptography.AsymmetricAlgorithm
public abstract class ECDiffieHellman : System.Security.Cryptography.ECAlgorithm
public abstract class ECDiffieHellman : System.Security.Cryptography.AsymmetricAlgorithm
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type ECDiffieHellman = class
    inherit AsymmetricAlgorithm
type ECDiffieHellman = class
    inherit ECAlgorithm
type ECDiffieHellman = class
    inherit AsymmetricAlgorithm
Public MustInherit Class ECDiffieHellman
Inherits AsymmetricAlgorithm
Public MustInherit Class ECDiffieHellman
Inherits ECAlgorithm
Inheritance
ECDiffieHellman
Inheritance
Derived
Attributes

Remarks

This class serves as the abstract base class for ECDH implementations.

Constructors

ECDiffieHellman()

Initializes a new instance of the ECDiffieHellman class.

Fields

KeySizeValue

Represents the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizesValue

Specifies the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)

Properties

KeyExchangeAlgorithm

Gets the name of the key exchange algorithm.

KeySize

Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
LegalKeySizes

Gets the key sizes that are supported by the asymmetric algorithm.

(Inherited from AsymmetricAlgorithm)
PublicKey

Gets the public key that is being used by the current Elliptic Curve Diffie-Hellman (ECDH) instance.

SignatureAlgorithm

Gets the name of the signature algorithm.

Methods

Clear()

Releases all resources used by the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
Create()

Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm.

Create(ECCurve)

Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm with a new public/private key-pair generated over the specified curve.

Create(ECParameters)

Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm with the key described by the specified ECParameters object.

Create(String)
Obsolete.

Creates a new instance of the specified implementation of the Elliptic Curve Diffie-Hellman (ECDH) algorithm.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[])

When implemented in a derived class, performs key derivation using a specified hash algorithm with optional prepended or appended data.

DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)

Performs key derivation using a specified hash algorithm.

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[], Byte[])

When implemented in a derived class, performs key derivation using a specified HMAC (Hash-based Message Authentication Code) algorithm with optional prepended or appended data.

DeriveKeyFromHmac(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[])

Performs key derivation using a specified HMAC (Hash-based Message Authentication Code) algorithm.

DeriveKeyMaterial(ECDiffieHellmanPublicKey)

When implemented in a derived class, performs a key derivation on the shared secret.

DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[])

When implemented in a derived class, performs key derivation using the TLS (Transport Layer Security) 1.1 PRF (Pseudo-Random Function).

DeriveRawSecretAgreement(ECDiffieHellmanPublicKey)

Derive raw key material.

Dispose()

Releases all resources used by the current instance of the AsymmetricAlgorithm class.

(Inherited from AsymmetricAlgorithm)
Dispose(Boolean)

Releases the unmanaged resources used by the AsymmetricAlgorithm class and optionally releases the managed resources.

(Inherited from AsymmetricAlgorithm)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExportECPrivateKey()

Exports the current key in the ECPrivateKey format.

ExportECPrivateKey()

Exports the current key in the ECPrivateKey format.

(Inherited from ECAlgorithm)
ExportECPrivateKeyPem()

Exports the current key in the ECPrivateKey format, PEM encoded.

(Inherited from ECAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.

(Inherited from AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.

(Inherited from AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)

Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password, PEM encoded.

(Inherited from AsymmetricAlgorithm)
ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)

Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password, PEM encoded.

(Inherited from AsymmetricAlgorithm)
ExportExplicitParameters(Boolean)

When overridden in a derived class, exports either the public or the public and private key information using the explicit curve form from a working ECDiffieHellman key to an ECParameters structure so that it can be passed to the ImportParameters(ECParameters) method.

ExportExplicitParameters(Boolean)

When overridden in a derived class, exports the explicit ECParameters for an ECCurve.

(Inherited from ECAlgorithm)
ExportParameters(Boolean)

When overridden in a derived class, exports either the public or the public and private key information from a working ECDiffieHellman key to an ECParameters structure so that it can be passed to the ImportParameters(ECParameters) method.

ExportParameters(Boolean)

When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve. If the curve has a name, the Curve property will contain named curve parameters otherwise it will contain explicit parameters.

(Inherited from ECAlgorithm)
ExportPkcs8PrivateKey()

Exports the current key in the PKCS#8 PrivateKeyInfo format.

(Inherited from AsymmetricAlgorithm)
ExportPkcs8PrivateKeyPem()

Exports the current key in the PKCS#8 PrivateKeyInfo format, PEM encoded.

(Inherited from AsymmetricAlgorithm)
ExportSubjectPublicKeyInfo()

Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.

(Inherited from AsymmetricAlgorithm)
ExportSubjectPublicKeyInfoPem()

Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format, PEM encoded.

(Inherited from AsymmetricAlgorithm)
FromXmlString(String)

This method throws in all cases.

FromXmlString(String)

When overridden in a derived class, reconstructs an AsymmetricAlgorithm object from an XML string. Otherwise, throws a NotImplementedException.

(Inherited from AsymmetricAlgorithm)
GenerateKey(ECCurve)

When overridden in a derived class, generates a new ephemeral public/private key pair for the specified curve.

GenerateKey(ECCurve)

When overridden in a derived class, generates a new public/private keypair for the specified curve.

(Inherited from ECAlgorithm)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
ImportECPrivateKey(ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from an ECPrivateKey structure, replacing the keys for this object.

ImportECPrivateKey(ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from an ECPrivateKey structure, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a byte-based password, replacing the keys for this object.

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

When overridden in a derived class, imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a byte-based password, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a byte-based password, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a char-based password, replacing the keys for this object.

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

When overridden in a derived class, imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a char-based password, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo structure after decrypting with a byte-based password, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

When overridden in a derived class, imports an encrypted RFC 7468 PEM-encoded key, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Byte>)

Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

When overridden in a derived class, imports an encrypted RFC 7468 PEM-encoded key, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportFromEncryptedPem(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportFromPem(ReadOnlySpan<Char>)

Imports an RFC 7468 PEM-encoded key, replacing the keys for this object.

ImportFromPem(ReadOnlySpan<Char>)

When overridden in a derived class, imports an RFC 7468 textually encoded key, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportFromPem(ReadOnlySpan<Char>)

Imports an RFC 7468 PEM-encoded key, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportParameters(ECParameters)

When overridden in a derived class, imports the specified parameters for an ECCurve as an ephemeral key into the current ECDiffieHellman object.

ImportParameters(ECParameters)

When overridden in a derived class, imports the specified ECParameters.

(Inherited from ECAlgorithm)
ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure after decryption, replacing the keys for this object.

ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32)

When overriden in a derived class, imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure after decryption, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportPkcs8PrivateKey(ReadOnlySpan<Byte>, Int32)

Imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure after decryption, replacing the keys for this object.

(Inherited from ECAlgorithm)
ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32)

Imports the public key from an X.509 SubjectPublicKeyInfo structure after decryption, replacing the keys for this object.

ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32)

When overriden in a derived class, imports the public key from an X.509 SubjectPublicKeyInfo structure after decryption, replacing the keys for this object.

(Inherited from AsymmetricAlgorithm)
ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32)

Imports the public key from an X.509 SubjectPublicKeyInfo structure after decryption, replacing the keys for this object

(Inherited from ECAlgorithm)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)
ToXmlString(Boolean)

This method throws in all cases.

ToXmlString(Boolean)

When overridden in a derived class, creates and returns an XML string representation of the current AsymmetricAlgorithm object. Otherwise, throws a NotImplementedException.

(Inherited from AsymmetricAlgorithm)
TryExportECPrivateKey(Span<Byte>, Int32)

Attempts to export the current key in the ECPrivateKey format into a provided buffer.

TryExportECPrivateKey(Span<Byte>, Int32)

Attempts to export the current key in the ECPrivateKey format into a provided buffer.

(Inherited from ECAlgorithm)
TryExportECPrivateKeyPem(Span<Char>, Int32)

Attempts to export the current key in the PEM-encoded ECPrivateKey format into a provided buffer.

(Inherited from ECAlgorithm)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a byte-based password.

TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

When overridden in a derived class, attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a byte-based password.

(Inherited from AsymmetricAlgorithm)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters, Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a byte-based password.

(Inherited from ECAlgorithm)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a char-based password.

TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

When overriden in a derived class, attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a char-based password.

(Inherited from AsymmetricAlgorithm)
TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters, Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer, using a char-based password.

(Inherited from ECAlgorithm)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters, Span<Char>, Int32)

Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password, PEM encoded.

(Inherited from AsymmetricAlgorithm)
TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters, Span<Char>, Int32)

Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password, PEM encoded.

(Inherited from AsymmetricAlgorithm)
TryExportPkcs8PrivateKey(Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 PrivateKeyInfo format into a provided buffer.

TryExportPkcs8PrivateKey(Span<Byte>, Int32)

When overridden in a derived class, attempts to export the current key in the PKCS#8 PrivateKeyInfo format into a provided buffer.

(Inherited from AsymmetricAlgorithm)
TryExportPkcs8PrivateKey(Span<Byte>, Int32)

Attempts to export the current key in the PKCS#8 PrivateKeyInfo format into a provided buffer.

(Inherited from ECAlgorithm)
TryExportPkcs8PrivateKeyPem(Span<Char>, Int32)

Attempts to export the current key in the PEM-encoded PKCS#8 PrivateKeyInfo format into a provided buffer.

(Inherited from AsymmetricAlgorithm)
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

Attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.

TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

When overridden in a derived class, attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.

(Inherited from AsymmetricAlgorithm)
TryExportSubjectPublicKeyInfo(Span<Byte>, Int32)

Attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.

(Inherited from ECAlgorithm)
TryExportSubjectPublicKeyInfoPem(Span<Char>, Int32)

Attempts to export the current key in the PEM-encoded X.509 SubjectPublicKeyInfo format into a provided buffer.

(Inherited from AsymmetricAlgorithm)

Explicit Interface Implementations

IDisposable.Dispose()

This API supports the product infrastructure and is not intended to be used directly from your code.

For a description of this member, see Dispose().

(Inherited from AsymmetricAlgorithm)

Applies to