Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​Cryptography.​ECDsaCng

Assembly: System.Security.Cryptography

Inheritance: object → AsymmetricAlgorithmECAlgorithmECDsa → ECDsaCng

Implemented Interfaces

Provides a Cryptography Next Generation (CNG) implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA).

Fields and Constants

protected int
KeySizeValue
Represents the size, in bits, of the key modulus used by the asymmetric algorithm.
protected KeySizes[]
LegalKeySizesValue
Specifies the key sizes that are supported by the asymmetric algorithm.

Properties

public CngAlgorithm
HashAlgorithm
Gets or sets the hash algorithm to use when signing and verifying data.
public CngKey
Key
Gets or sets the key to use when signing and verifying data.
public int
KeySize
Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm.
public KeySizes[]
LegalKeySizes
Gets the key sizes, in bits, that are supported by the <see cref="P:System.Security.Cryptography.ECDsaCng.KeySize" /> property setter.
public string
KeyExchangeAlgorithm
Gets the name of the key exchange algorithm.
public string
SignatureAlgorithm
Gets the name of the signature algorithm.

Methods

protected void
Dispose​(bool disposing)
public byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters)
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
passwordBytes The bytes to use as a password when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​char> password, PbeParameters pbeParameters)
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public ECParameters
ExportExplicitParameters​(bool includePrivateParameters)
Exports the key and explicit curve parameters used by the Elliptic curve cryptography (ECC) object into an <see cref="T:System.Security.Cryptography.ECParameters" /> object.
Returns The key and explicit curve parameters used by the ECC object.
includePrivateParameters <see langword="true" /> to include private parameters; otherwise, <see langword="false" /> .
public ECParameters
ExportParameters​(bool includePrivateParameters)
Exports the key used by the Elliptic curve cryptography (ECC) object into an <see cref="T:System.Security.Cryptography.ECParameters" /> object. If the key was created as a named curve, the <see cref="F:System.Security.Cryptography.ECParameters.Curve" /> field contains named curve parameters; otherwise, it contains explicit parameters.
Returns The key and named curve parameters used by the ECC object.
includePrivateParameters <see langword="true" /> to include private parameters; otherwise, <see langword="false" /> .
public void
FromXmlString​(string xml, ECKeyXmlFormat format)
Deserializes the key information from an XML string by using the specified format.
xml The XML-based key information to be deserialized.
format One of the enumeration values that specifies the format of the XML string. The only currently accepted format is <see cref="F:System.Security.Cryptography.ECKeyXmlFormat.Rfc4050" /> .
public void
GenerateKey​(ECCurve curve)
Generates a new ephemeral public/private key pair for the specified curve, replacing the current key.
curve The curve to use to generate the key.
public void
ImportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​byte> passwordBytes, ReadOnlySpan<​byte> source, Int32& bytesRead)
public void
ImportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​char> password, ReadOnlySpan<​byte> source, Int32& bytesRead)
public void
ImportParameters​(ECParameters parameters)
Replaces the existing key that the current instance is working with by creating a new <see cref="T:System.Security.Cryptography.CngKey" /> for the parameters structure.
parameters The curve parameters.
public void
ImportPkcs8PrivateKey​(ReadOnlySpan<​byte> source, Int32& bytesRead)
public byte[]
SignData​(byte[] data)
Generates a signature for the specified data.
Returns A digital signature for the specified data.
data The message data to be signed.
public byte[]
SignData​(byte[] data, int offset, int count)
Generates a digital signature for the specified length of data, beginning at the specified offset.
Returns A digital signature for the specified length of data.
data The message data to be signed.
offset The location in the string at which to start signing.
count The length of the string, in characters, following <paramref name="offset" /> that will be signed.
public byte[]
SignData​(IO.​Stream data)
Generates a signature for the specified data stream, reading to the end of the stream.
Returns A digital signature for the specified data stream.
data The data stream to be signed.
public byte[]
SignHash​(byte[] hash)
Generates a signature for the specified hash value.
Returns A digital signature for the specified hash value.
hash The hash value of the data to be signed.
public string
ToXmlString​(ECKeyXmlFormat format)
Serializes the key information to an XML string by using the specified format.
Returns A string object that contains the key information, serialized to an XML string according to the requested format.
format One of the enumeration values that specifies the format of the XML string. The only currently accepted format is <see cref="F:System.Security.Cryptography.ECKeyXmlFormat.Rfc4050" /> .
public bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters, Span<​byte> destination, Int32& bytesWritten)
public bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​char> password, PbeParameters pbeParameters, Span<​byte> destination, Int32& bytesWritten)
public bool
TryExportPkcs8PrivateKey​(Span<​byte> destination, Int32& bytesWritten)
public bool
TrySignHash​(ReadOnlySpan<​byte> source, Span<​byte> destination, Int32& bytesWritten)
protected bool
TrySignHashCore​(ReadOnlySpan<​byte> hash, Span<​byte> destination, DSASignatureFormat signatureFormat, Int32& bytesWritten)
public bool
VerifyData​(byte[] data, byte[] signature)
Verifies the digital signature of the specified data.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The data that was signed.
signature The signature to be verified.
public bool
VerifyData​(byte[] data, int offset, int count, byte[] signature)
Verifies a signature for the specified length of data, beginning at the specified offset.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The data that was signed.
offset The location in the data at which the signed data begins.
count The length of the data, in characters, following <paramref name="offset" /> that will be signed.
signature The signature to be verified.
public bool
VerifyData​(IO.​Stream data, byte[] signature)
Verifies the digital signature of the specified data stream, reading to the end of the stream.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The data stream that was signed.
signature The signature to be verified.
public bool
VerifyHash​(byte[] hash, byte[] signature)
Verifies that a digital signature is appropriate for the current key and provided data hash.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
hash The hash value of the data to be verified.
signature The digital signature of the data to be verified against the hash value.
public bool
VerifyHash​(ReadOnlySpan<​byte> hash, ReadOnlySpan<​byte> signature)
Verifies that a digital signature is appropriate for the current key and provided data hash.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
hash The hash value of the data to be verified.
signature The digital signature of the data to be verified against the hash value.
protected bool
VerifyHashCore​(ReadOnlySpan<​byte> hash, ReadOnlySpan<​byte> signature, DSASignatureFormat signatureFormat)
public void
FromXmlString​(string xmlString)
Inherited from ECDsa
This method throws in all cases.
xmlString The XML string to use to reconstruct the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> object.
public int
GetMaxSignatureSize​(DSASignatureFormat signatureFormat)
Inherited from ECDsa
Gets the largest size, in bytes, for a signature produced by this key in the indicated format.
Returns The largest size, in bytes, for a signature produced by this key in the indicated format.
signatureFormat The encoding format for a signature.
protected byte[]
HashData​(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
When overridden in a derived class, computes the hash value of the specified portion of a byte array by using the specified hashing algorithm.
Returns The hashed data.
data The data to be hashed.
offset The index of the first byte in <paramref name="data" /> to be hashed.
count The number of bytes to hash.
hashAlgorithm The algorithm to use to hash the data.
protected byte[]
HashData​(IO.​Stream data, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
When overridden in a derived class, computes the hash value of the specified binary stream by using the specified hashing algorithm.
Returns The hashed data.
data The binary stream to hash.
hashAlgorithm The algorithm to use to hash the data.
public byte[]
SignData​(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value.
Returns The ECDSA signature for the specified data.
data The input data for which to compute the hash.
offset The offset into the array at which to begin using data.
count The number of bytes in the array to use as data.
hashAlgorithm The hash algorithm to use to create the hash value.
public byte[]
SignData​(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to sign.
offset The offset into <paramref name="data" /> at which to begin hashing.
count The number of bytes to read from <paramref name="data" /> .
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
public byte[]
SignData​(byte[] data, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value.
Returns The ECDSA signature for the specified data.
data The input data for which to compute the hash.
hashAlgorithm The hash algorithm to use to create the hash value.
public byte[]
SignData​(byte[] data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to sign.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
public byte[]
SignData​(IO.​Stream data, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value.
Returns The ECDSA signature for the specified data.
data The input stream for which to compute the hash.
hashAlgorithm The hash algorithm to use to create the hash value.
public byte[]
SignData​(IO.​Stream data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to sign.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
public byte[]
SignData​(ReadOnlySpan<​byte> data, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Computes the hash value of the specified data and signs it.
Returns The ECDSA signature for the specified data.
data The data to hash and sign.
hashAlgorithm The hash algorithm to use to create the hash value.
public byte[]
SignData​(ReadOnlySpan<​byte> data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to hash and sign.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
public int
SignData​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Computes the hash value of the specified data and signs it in the indicated format into the provided buffer.
Returns The total number of bytes written to <paramref name="destination" /> .
data The data to hash and sign.
destination The buffer to receive the signature.
hashAlgorithm The hash algorithm to use to create the hash value.
public int
SignData​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it in the indicated format into the provided buffer.
Returns The total number of bytes written to <paramref name="destination" /> .
data The data to hash and sign.
destination The buffer to receive the signature.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
protected byte[]
SignDataCore​(IO.​Stream data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to sign.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
protected byte[]
SignDataCore​(ReadOnlySpan<​byte> data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the hash value of the specified data and signs it using the specified signature format.
Returns The ECDSA signature for the specified data.
data The data to sign.
hashAlgorithm The hash algorithm to use to create the hash value.
signatureFormat The encoding format to use for the signature.
public byte[]
SignHash​(byte[] hash, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value in the indicated format.
Returns The ECDSA signature for the specified data.
hash The hash value to sign.
signatureFormat The encoding format to use for the signature.
public byte[]
SignHash​(ReadOnlySpan<​byte> hash)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value.
Returns A digital signature for the specified hash value.
hash The hash value of the data that is being signed.
public byte[]
SignHash​(ReadOnlySpan<​byte> hash, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value in the indicated format.
Returns A digital signature for the specified hash value.
hash The hash value of the data that is being signed.
signatureFormat The encoding format to use for the signature.
public int
SignHash​(ReadOnlySpan<​byte> hash, Span<​byte> destination)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value into the provided buffer.
Returns The total number of bytes written to <paramref name="destination" /> .
hash The hash value of the data that is being signed.
destination The buffer to receive the signature.
public int
SignHash​(ReadOnlySpan<​byte> hash, Span<​byte> destination, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value in the indicated format into the provided buffer.
Returns The total number of bytes written to <paramref name="destination" /> .
hash The hash value of the data that is being signed.
destination The buffer to receive the signature.
signatureFormat The encoding format to use for the signature.
protected byte[]
SignHashCore​(ReadOnlySpan<​byte> hash, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Computes the ECDSA signature for the specified hash value in the indicated format.
Returns The ECDSA signature for the specified data.
hash The hash value to sign.
signatureFormat The encoding format to use for the signature.
public string
ToXmlString​(bool includePrivateParameters)
Inherited from ECDsa
This method throws in all cases.
Returns This method does not return a value.
includePrivateParameters <see langword="true" /> to include private parameters; otherwise, <see langword="false" /> .
protected bool
TryHashData​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm, Int32& bytesWritten)
Inherited from ECDsa
public bool
TrySignData​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm, Int32& bytesWritten)
Inherited from ECDsa
public bool
TrySignData​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat, Int32& bytesWritten)
Inherited from ECDsa
protected bool
TrySignDataCore​(ReadOnlySpan<​byte> data, Span<​byte> destination, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat, Int32& bytesWritten)
Inherited from ECDsa
public bool
TrySignHash​(ReadOnlySpan<​byte> hash, Span<​byte> destination, DSASignatureFormat signatureFormat, Int32& bytesWritten)
Inherited from ECDsa
public bool
VerifyData​(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The signed data.
signature The signature data to be verified.
hashAlgorithm The hash algorithm used to create the hash value of the data.
public bool
VerifyData​(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
public bool
VerifyData​(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Verifies that a digital signature is appropriate for the current key and provided portion of data with a specified hash algorithm.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The signed data.
offset The starting index at which to compute the hash.
count The number of bytes to hash.
signature The signature data to be verified.
hashAlgorithm The hash algorithm used to create the hash value of the data.
public bool
VerifyData​(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data An array that contains the signed data.
offset The starting index of the signed portion of <paramref name="data" /> .
count The number of bytes in <paramref name="data" /> that were signed.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
public bool
VerifyData​(IO.​Stream data, byte[] signature, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The signed data.
signature The signature data to be verified.
hashAlgorithm The hash algorithm used to create the hash value of the data.
public bool
VerifyData​(IO.​Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
public bool
VerifyData​(ReadOnlySpan<​byte> data, ReadOnlySpan<​byte> signature, HashAlgorithmName hashAlgorithm)
Inherited from ECDsa
Verifies that a digital signature is appropriate for the current key and provided data with a specified hash algorithm.
Returns <see langword="true" /> if the signature is valid; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to be verified.
hashAlgorithm The hash algorithm used to create the hash value of the data.
public bool
VerifyData​(ReadOnlySpan<​byte> data, ReadOnlySpan<​byte> signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
protected bool
VerifyDataCore​(IO.​Stream data, ReadOnlySpan<​byte> signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
protected bool
VerifyDataCore​(ReadOnlySpan<​byte> data, ReadOnlySpan<​byte> signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided data.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
data The signed data.
signature The signature to verify.
hashAlgorithm The hash algorithm used to hash the data for the verification process.
signatureFormat The encoding format for <paramref name="signature" /> .
public bool
VerifyHash​(byte[] hash, byte[] signature, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided hash.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
hash The signed hash.
signature The signature to verify.
signatureFormat The encoding format for <paramref name="signature" /> .
public bool
VerifyHash​(ReadOnlySpan<​byte> hash, ReadOnlySpan<​byte> signature, DSASignatureFormat signatureFormat)
Inherited from ECDsa
Verifies that a digital signature is valid for the provided hash.
Returns <see langword="true" /> if the digital signature is valid for the provided data; otherwise, <see langword="false" /> .
hash The signed hash.
signature The signature to verify.
signatureFormat The encoding format for <paramref name="signature" /> .
public byte[]
ExportECPrivateKey​()
Inherited from ECAlgorithm
Exports the current key in the ECPrivateKey format.
Returns A byte array containing the ECPrivateKey representation of this key.
public string
ExportECPrivateKeyPem​()
Inherited from ECAlgorithm
Exports the current key in the ECPrivateKey format, PEM encoded.
Returns A string containing the PEM-encoded ECPrivateKey.
public void
ImportECPrivateKey​(ReadOnlySpan<​byte> source, Int32& bytesRead)
Inherited from ECAlgorithm
public void
ImportFromEncryptedPem​(ReadOnlySpan<​char> input, ReadOnlySpan<​byte> passwordBytes)
Inherited from ECAlgorithm
Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.
input The PEM text of the encrypted key to import.
passwordBytes The bytes to use as a password when decrypting the key material.
public void
ImportFromEncryptedPem​(ReadOnlySpan<​char> input, ReadOnlySpan<​char> password)
Inherited from ECAlgorithm
Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object.
input The PEM text of the encrypted key to import.
password The password to use for decrypting the key material.
public void
ImportFromPem​(ReadOnlySpan<​char> input)
Inherited from ECAlgorithm
Imports an RFC 7468 PEM-encoded key, replacing the keys for this object.
input The PEM text of the key to import.
public void
ImportSubjectPublicKeyInfo​(ReadOnlySpan<​byte> source, Int32& bytesRead)
Inherited from ECAlgorithm
public bool
TryExportECPrivateKey​(Span<​byte> destination, Int32& bytesWritten)
Inherited from ECAlgorithm
public bool
TryExportECPrivateKeyPem​(Span<​char> destination, Int32& charsWritten)
Inherited from ECAlgorithm
public bool
TryExportSubjectPublicKeyInfo​(Span<​byte> destination, Int32& bytesWritten)
Inherited from ECAlgorithm
public void
Clear​()
Inherited from AsymmetricAlgorithm
Releases all resources used by the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> class.
public void
Dispose​()
Inherited from AsymmetricAlgorithm
Releases all resources used by the current instance of the <see cref="T:System.Security.Cryptography.AsymmetricAlgorithm" /> class.
public string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters)
Inherited from AsymmetricAlgorithm
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password, PEM encoded.
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
passwordBytes The bytes to use as a password when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​char> password, PbeParameters pbeParameters)
Inherited from AsymmetricAlgorithm
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password, PEM encoded.
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public byte[]
ExportPkcs8PrivateKey​()
Inherited from AsymmetricAlgorithm
Exports the current key in the PKCS#8 PrivateKeyInfo format.
Returns A byte array containing the PKCS#8 PrivateKeyInfo representation of this key.
public string
ExportPkcs8PrivateKeyPem​()
Inherited from AsymmetricAlgorithm
Exports the current key in the PKCS#8 PrivateKeyInfo format, PEM encoded.
Returns A string containing the PEM-encoded PKCS#8 PrivateKeyInfo.
public byte[]
ExportSubjectPublicKeyInfo​()
Inherited from AsymmetricAlgorithm
Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.
Returns A byte array containing the X.509 SubjectPublicKeyInfo representation of the public-key portion of this key.
public string
ExportSubjectPublicKeyInfoPem​()
Inherited from AsymmetricAlgorithm
Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format, PEM encoded.
Returns A string containing the PEM-encoded X.509 SubjectPublicKeyInfo.
public bool
TryExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters, Span<​char> destination, Int32& charsWritten)
Inherited from AsymmetricAlgorithm
public bool
TryExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​char> password, PbeParameters pbeParameters, Span<​char> destination, Int32& charsWritten)
Inherited from AsymmetricAlgorithm
public bool
TryExportPkcs8PrivateKeyPem​(Span<​char> destination, Int32& charsWritten)
Inherited from AsymmetricAlgorithm
public bool
TryExportSubjectPublicKeyInfoPem​(Span<​char> destination, Int32& charsWritten)
Inherited from AsymmetricAlgorithm
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object