КриптоПро .NET
Search Results for

    Показать/Скрыть содержание

    Class CpECDsa

    Inheritance
    object
    AsymmetricAlgorithm
    CpECDsa
    CpECDsaCryptoServiceProvider
    Implements
    IDisposable
    Inherited Members
    AsymmetricAlgorithm.KeySizeValue
    AsymmetricAlgorithm.LegalKeySizesValue
    AsymmetricAlgorithm.Clear()
    AsymmetricAlgorithm.Create(string)
    AsymmetricAlgorithm.Dispose()
    AsymmetricAlgorithm.Dispose(bool)
    AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte>, PbeParameters)
    AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char>, PbeParameters)
    AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte>, PbeParameters)
    AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char>, PbeParameters)
    AsymmetricAlgorithm.ExportPkcs8PrivateKey()
    AsymmetricAlgorithm.ExportPkcs8PrivateKeyPem()
    AsymmetricAlgorithm.ExportSubjectPublicKeyInfo()
    AsymmetricAlgorithm.ExportSubjectPublicKeyInfoPem()
    AsymmetricAlgorithm.FromXmlString(string)
    AsymmetricAlgorithm.ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte>, ReadOnlySpan<byte>, out int)
    AsymmetricAlgorithm.ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char>, ReadOnlySpan<byte>, out int)
    AsymmetricAlgorithm.ImportFromEncryptedPem(ReadOnlySpan<char>, ReadOnlySpan<byte>)
    AsymmetricAlgorithm.ImportFromEncryptedPem(ReadOnlySpan<char>, ReadOnlySpan<char>)
    AsymmetricAlgorithm.ImportFromPem(ReadOnlySpan<char>)
    AsymmetricAlgorithm.ImportPkcs8PrivateKey(ReadOnlySpan<byte>, out int)
    AsymmetricAlgorithm.ImportSubjectPublicKeyInfo(ReadOnlySpan<byte>, out int)
    AsymmetricAlgorithm.ToXmlString(bool)
    AsymmetricAlgorithm.TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte>, PbeParameters, Span<byte>, out int)
    AsymmetricAlgorithm.TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char>, PbeParameters, Span<byte>, out int)
    AsymmetricAlgorithm.TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte>, PbeParameters, Span<char>, out int)
    AsymmetricAlgorithm.TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char>, PbeParameters, Span<char>, out int)
    AsymmetricAlgorithm.TryExportPkcs8PrivateKey(Span<byte>, out int)
    AsymmetricAlgorithm.TryExportPkcs8PrivateKeyPem(Span<char>, out int)
    AsymmetricAlgorithm.TryExportSubjectPublicKeyInfo(Span<byte>, out int)
    AsymmetricAlgorithm.TryExportSubjectPublicKeyInfoPem(Span<char>, out int)
    AsymmetricAlgorithm.KeySize
    AsymmetricAlgorithm.LegalKeySizes
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: CryptoPro.Security.Cryptography
    Assembly: CryptoPro.Security.Cryptography.dll
    Syntax
    public abstract class CpECDsa : AsymmetricAlgorithm, IDisposable

    Properties

    KeyExchangeAlgorithm

    When overridden in a derived class, gets the name of the key exchange algorithm. Otherwise, throws an NotImplementedException.

    Declaration
    public override string KeyExchangeAlgorithm { get; }
    Property Value
    Type Description
    string

    The name of the key exchange algorithm.

    Overrides
    AsymmetricAlgorithm.KeyExchangeAlgorithm

    SignatureAlgorithm

    When implemented in a derived class, gets the name of the signature algorithm. Otherwise, always throws a NotImplementedException.

    Declaration
    public override string SignatureAlgorithm { get; }
    Property Value
    Type Description
    string

    The name of the signature algorithm.

    Overrides
    AsymmetricAlgorithm.SignatureAlgorithm

    Methods

    Create()

    Declaration
    public static CpECDsa Create()
    Returns
    Type Description
    CpECDsa

    Create(int)

    Declaration
    public static CpECDsa Create(int keySizeInBits)
    Parameters
    Type Name Description
    int keySizeInBits
    Returns
    Type Description
    CpECDsa

    Create(ECParameters)

    Declaration
    public static CpECDsa Create(ECParameters parameters)
    Parameters
    Type Name Description
    ECParameters parameters
    Returns
    Type Description
    CpECDsa

    ExportParameters(bool)

    Declaration
    public abstract ECParameters ExportParameters(bool includePrivateParameters)
    Parameters
    Type Name Description
    bool includePrivateParameters
    Returns
    Type Description
    ECParameters

    GetMaxSignatureSize(DSASignatureFormat)

    Gets the largest size, in bytes, for a signature produced by this key in the indicated format.

    Declaration
    public int GetMaxSignatureSize(DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    DSASignatureFormat signatureFormat

    The encoding format for a signature.

    Returns
    Type Description
    int

    The largest size, in bytes, for a signature produced by this key in the indicated format.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    signatureFormat is not a known format.

    HashData(byte[], int, int, CpHashAlgorithmName)

    Declaration
    protected virtual byte[] HashData(byte[] data, int offset, int count, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    HashData(Stream, CpHashAlgorithmName)

    Declaration
    protected virtual byte[] HashData(Stream data, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    Stream data
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    ImportParameters(ECParameters)

    Declaration
    public abstract void ImportParameters(ECParameters parameters)
    Parameters
    Type Name Description
    ECParameters parameters

    ImportPublicKey(ReadOnlySpan<byte>, ReadOnlySpan<byte>)

    Declaration
    public abstract void ImportPublicKey(ReadOnlySpan<byte> encodedPublicKey, ReadOnlySpan<byte> encodedParameters)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> encodedPublicKey
    ReadOnlySpan<byte> encodedParameters

    SignData(byte[], CpHashAlgorithmName)

    Declaration
    public byte[] SignData(byte[] data, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] data
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    SignData(byte[], CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public byte[] SignData(byte[] data, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    byte[] data
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    byte[]

    SignData(byte[], int, int, CpHashAlgorithmName)

    Declaration
    public virtual byte[] SignData(byte[] data, int offset, int count, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    SignData(byte[], int, int, CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public virtual byte[] SignData(byte[] data, int offset, int count, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    byte[]

    SignData(Stream, CpHashAlgorithmName)

    Declaration
    public virtual byte[] SignData(Stream data, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    Stream data
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    SignData(ReadOnlySpan<byte>, CpHashAlgorithmName)

    Computes the hash value of the specified data and signs it.

    Declaration
    public byte[] SignData(ReadOnlySpan<byte> data, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> data

    The input data to hash and sign.

    CpHashAlgorithmName hashAlgorithm

    The hash algorithm to use to create the hash value.

    Returns
    Type Description
    byte[]

    The ECDSA signature for the specified data.

    Exceptions
    Type Condition
    ArgumentException

    hashAlgorithm's Name is an empty string.

    CryptographicException

    This instance represents only a public key.

    -or-

    An error occurred creating the signature.

    SignData(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName)

    Computes the hash of the provided data with the specified algorithm and sign the hash with the current key, writing the signature into a provided buffer.

    Declaration
    public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> data

    The input data to hash and sign.

    Span<byte> destination

    The buffer to receive the ECDSA signature.

    CpHashAlgorithmName hashAlgorithm

    The hash algorithm to use to create the hash value.

    Returns
    Type Description
    int

    The total number of bytes written to destination.

    Exceptions
    Type Condition
    ArgumentException

    hashAlgorithm's Name is an empty string.

    -or-

    The buffer in destination is too small to hold the signature.

    CryptographicException

    This instance represents only a public key.

    -or-

    An error occurred creating the signature.

    SignHash(byte[], CpHashAlgorithmName)

    Declaration
    public virtual byte[] SignHash(byte[] hash, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] hash
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    SignHash(byte[], CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public virtual byte[] SignHash(byte[] hash, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    byte[] hash
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    byte[]

    SignHash(ReadOnlySpan<byte>, CpHashAlgorithmName)

    Declaration
    public byte[] SignHash(ReadOnlySpan<byte> hash, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    SignHash(ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)

    Computes the signature for the specified hash value.

    Declaration
    public byte[] SignHash(ReadOnlySpan<byte> hash, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash

    The hash value of the data to be signed.

    CpHashAlgorithmName hashAlgorithm

    The hash algorithm used to create the hash of hash.

    DSASignatureFormat signatureFormat
    Returns
    Type Description
    byte[]

    The ECDSA signature for the specified hash value.

    Exceptions
    Type Condition
    ArgumentException

    hashAlgorithm's Name is an empty string.

    CryptographicException

    This instance represents only a public key.

    -or-

    An error occurred creating the signature.

    SignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName)

    Sign the hash with the current key, writing the signature into a provided buffer.

    Declaration
    public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash

    The hash value of the data to be signed.

    Span<byte> destination

    The buffer to receive the ECDSA signature.

    CpHashAlgorithmName hashAlgorithm

    The hash algorithm used to create the hash of hash.

    Returns
    Type Description
    int

    The total number of bytes written to destination.

    Exceptions
    Type Condition
    ArgumentException

    hashAlgorithm's Name is an empty string.

    -or-

    The buffer in destination is too small to hold the signature.

    CryptographicException

    This instance represents only a public key.

    -or-

    An error occurred creating the signature.

    TryHashData(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)

    Declaration
    protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> data
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    int bytesWritten
    Returns
    Type Description
    bool

    TrySignData(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)

    Declaration
    public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> data
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    int bytesWritten
    Returns
    Type Description
    bool

    TrySignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)

    Declaration
    public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    int bytesWritten
    Returns
    Type Description
    bool

    TrySignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, DSASignatureFormat, out int)

    Declaration
    public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    int bytesWritten
    Returns
    Type Description
    bool

    TrySignHashCore(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)

    Declaration
    protected virtual bool TrySignHashCore(ReadOnlySpan<byte> hash, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    int bytesWritten
    Returns
    Type Description
    bool

    TrySignHashCore(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, DSASignatureFormat, out int)

    Declaration
    protected abstract bool TrySignHashCore(ReadOnlySpan<byte> hash, Span<byte> destination, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    Span<byte> destination
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    int bytesWritten
    Returns
    Type Description
    bool

    VerifyData(byte[], byte[], CpHashAlgorithmName)

    Declaration
    public bool VerifyData(byte[] data, byte[] signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] data
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyData(byte[], byte[], CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public bool VerifyData(byte[] data, byte[] signature, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    byte[] data
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    bool

    VerifyData(byte[], int, int, byte[], CpHashAlgorithmName)

    Declaration
    public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyData(byte[], int, int, byte[], CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    bool

    VerifyData(Stream, byte[], CpHashAlgorithmName)

    Declaration
    public bool VerifyData(Stream data, byte[] signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    Stream data
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyData(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName)

    Declaration
    public virtual bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> data
    ReadOnlySpan<byte> signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyHash(byte[], byte[], CpHashAlgorithmName)

    Declaration
    public virtual bool VerifyHash(byte[] hash, byte[] signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    byte[] hash
    byte[] signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyHash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName)

    Declaration
    public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    ReadOnlySpan<byte> signature
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    VerifyHash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)

    Declaration
    public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash
    ReadOnlySpan<byte> signature
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    bool

    VerifyHashCore(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName)

    Verifies that a digital signature is valid for the provided hash.

    Declaration
    protected virtual bool VerifyHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash

    The signed hash.

    ReadOnlySpan<byte> signature

    The signature to verify.

    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    bool

    true if the digital signature is valid for the provided data; otherwise, false.

    Exceptions
    Type Condition
    CryptographicException

    An error occurred in the verification operation.

    VerifyHashCore(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)

    Verifies that a digital signature is valid for the provided hash.

    Declaration
    protected abstract bool VerifyHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> hash

    The signed hash.

    ReadOnlySpan<byte> signature

    The signature to verify.

    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    bool

    true if the digital signature is valid for the provided data; otherwise, false.

    Exceptions
    Type Condition
    CryptographicException

    An error occurred in the verification operation.

    Implements

    IDisposable
    В этом разделе
    Наверх Generated by DocFX