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

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

    Class CpECDsaCryptoServiceProvider

    Inheritance
    object
    AsymmetricAlgorithm
    CpECDsa
    CpECDsaCryptoServiceProvider
    Implements
    IDisposable
    ICpCspAsymmetricAlgorithm
    Inherited Members
    CpECDsa.Create()
    CpECDsa.Create(int)
    CpECDsa.Create(ECParameters)
    CpECDsa.GetMaxSignatureSize(DSASignatureFormat)
    CpECDsa.SignHash(byte[], CpHashAlgorithmName)
    CpECDsa.SignHash(byte[], CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.VerifyHash(byte[], byte[], CpHashAlgorithmName)
    CpECDsa.TrySignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)
    CpECDsa.TrySignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, DSASignatureFormat, out int)
    CpECDsa.VerifyHash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName)
    CpECDsa.VerifyHash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.SignData(byte[], CpHashAlgorithmName)
    CpECDsa.SignData(byte[], CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.SignData(byte[], int, int, CpHashAlgorithmName)
    CpECDsa.SignData(byte[], int, int, CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.SignData(Stream, CpHashAlgorithmName)
    CpECDsa.TrySignData(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, out int)
    CpECDsa.SignData(ReadOnlySpan<byte>, CpHashAlgorithmName)
    CpECDsa.SignData(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName)
    CpECDsa.SignHash(ReadOnlySpan<byte>, CpHashAlgorithmName)
    CpECDsa.SignHash(ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.SignHash(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName)
    CpECDsa.VerifyData(byte[], byte[], CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.VerifyData(byte[], byte[], CpHashAlgorithmName)
    CpECDsa.VerifyData(byte[], int, int, byte[], CpHashAlgorithmName)
    CpECDsa.VerifyData(byte[], int, int, byte[], CpHashAlgorithmName, DSASignatureFormat)
    CpECDsa.VerifyData(Stream, byte[], CpHashAlgorithmName)
    CpECDsa.VerifyData(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName)
    CpECDsa.KeyExchangeAlgorithm
    AsymmetricAlgorithm.Clear()
    AsymmetricAlgorithm.Create(string)
    AsymmetricAlgorithm.Dispose()
    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.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)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: CryptoPro.Security.Cryptography
    Assembly: CryptoPro.Security.Cryptography.dll
    Syntax
    public sealed class CpECDsaCryptoServiceProvider : CpECDsa, IDisposable, ICpCspAsymmetricAlgorithm

    Constructors

    CpECDsaCryptoServiceProvider()

    Declaration
    public CpECDsaCryptoServiceProvider()

    CpECDsaCryptoServiceProvider(CpCspParameters)

    Declaration
    public CpECDsaCryptoServiceProvider(CpCspParameters parameters)
    Parameters
    Type Name Description
    CpCspParameters parameters

    CpECDsaCryptoServiceProvider(int)

    Declaration
    public CpECDsaCryptoServiceProvider(int dwKeySize)
    Parameters
    Type Name Description
    int dwKeySize

    CpECDsaCryptoServiceProvider(int, CpCspParameters)

    Declaration
    public CpECDsaCryptoServiceProvider(int dwKeySize, CpCspParameters parameters)
    Parameters
    Type Name Description
    int dwKeySize
    CpCspParameters parameters

    Properties

    ContainerCertificate

    Получение/установка сертификата в конейнер.

    Declaration
    public byte[] ContainerCertificate { get; set; }
    Property Value
    Type Description
    byte[]

    Возвращается хранимый сертификат или null, если сертификат в контейнере отсутствует.

    CspKeyContainerInfo

    Получает информацию о CSP CspKeyContainerInfo, в котором хранится ключевая пара.

    Declaration
    public CpCspKeyContainerInfo CspKeyContainerInfo { get; }
    Property Value
    Type Description
    CpCspKeyContainerInfo

    Handle

    Gets a copy to a native HCRYPTPROV handle.

    Declaration
    public nint Handle { get; }
    Property Value
    Type Description
    nint

    HandleNoDuplicate

    Gets a native HCRYPTPROV handle.

    Declaration
    public nint HandleNoDuplicate { get; }
    Property Value
    Type Description
    nint

    KeySize

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

    Declaration
    public override int KeySize { get; }
    Property Value
    Type Description
    int

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

    Overrides
    AsymmetricAlgorithm.KeySize
    Remarks

    csp will return true Key size, which is double field size, dotnet code expect field size here.

    Exceptions
    Type Condition
    CryptographicException

    The key modulus size is invalid.

    KeySpec

    Gets a key specification.

    Declaration
    public int KeySpec { get; }
    Property Value
    Type Description
    int

    LegalKeySizes

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

    Declaration
    public override KeySizes[] LegalKeySizes { get; }
    Property Value
    Type Description
    KeySizes[]

    An array that contains the key sizes supported by the asymmetric algorithm.

    Overrides
    AsymmetricAlgorithm.LegalKeySizes

    NotAfter

    Срок действия закртытого ключа, указанного в KP_NOTAFTER

    Declaration
    public DateTimeOffset NotAfter { get; }
    Property Value
    Type Description
    DateTimeOffset

    PublicOnly

    Получает значение, указывающее, не содержит ли объект Gost3410_2012_256CryptoServiceProvider только открытый ключ.

    Declaration
    public bool PublicOnly { get; }
    Property Value
    Type Description
    bool

    true, если Gost3410_2012_256CryptoServiceProvider содержит только открытый ключ, false - иначе.

    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
    CpECDsa.SignatureAlgorithm

    UseMachineKeyStore

    Возвращает или устанавливает флаг того, что ключ должен храниться в STORE ключей компьютера, а не в профиле пользователя.

    Declaration
    public static bool UseMachineKeyStore { get; set; }
    Property Value
    Type Description
    bool

    true, если ключ должен храниться в банке ключей компьютера, false - иначе.

    Remarks

    Данный флаг устанавливает использование ключей из STORE пользователя или компьютера при открытии ключей без указания данного флага. Установка данного флага эквивалентна передаче установке флага UseMachineKeyStore в CspParameters. Свойство UseMachineKeyStore устанавливается для всего кода в текущем домене, в то время как CspParameters применимо только к объекту на который он ссылается. Установка/сброс данного флага полезна при имперсонализации или работе без загруженного профиля пользователя.

    При инициализации объекта через конструктор CpECDsaCryptoServiceProvider(CpCspParameters) будут использованы именно эти параметры, в независимости от флага UseMachineKeyStore. По умолчанию значение флага из CpECDsaCryptoServiceProvider(CpCspParameters) устанавливется в использование ключей из хранилищи пользователя. Для использования ключей из хранилища компьютера при использовании конструктора CpECDsaCryptoServiceProvider(CpCspParameters) необходимо установить флаг Flags: UseMachineKeyStore.

    Methods

    Dispose(bool)

    Dispose the key handles

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    AsymmetricAlgorithm.Dispose(bool)

    ExportCspBlob()

    Declaration
    public byte[] ExportCspBlob()
    Returns
    Type Description
    byte[]

    ExportCspBlob(bool)

    Exports a blob containing the key information associated with an ECDSACryptoServiceProvider object.

    Declaration
    public byte[] ExportCspBlob(bool includePrivateParameters)
    Parameters
    Type Name Description
    bool includePrivateParameters
    Returns
    Type Description
    byte[]

    ExportParameters(bool)

    Exports the EcParameters

    Declaration
    public override ECParameters ExportParameters(bool includePrivateParameters)
    Parameters
    Type Name Description
    bool includePrivateParameters
    Returns
    Type Description
    ECParameters
    Overrides
    CpECDsa.ExportParameters(bool)

    ImportCspBlob(byte[])

    Imports a blob that represents ECDSA key information

    Declaration
    public void ImportCspBlob(byte[] keyBlob)
    Parameters
    Type Name Description
    byte[] keyBlob

    ImportParameters(ECParameters)

    Imports the specified EcParameters

    Declaration
    public override void ImportParameters(ECParameters parameters)
    Parameters
    Type Name Description
    ECParameters parameters
    Overrides
    CpECDsa.ImportParameters(ECParameters)

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

    Declaration
    public override void ImportPublicKey(ReadOnlySpan<byte> encodedPublicKey, ReadOnlySpan<byte> encodedParameters)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> encodedPublicKey
    ReadOnlySpan<byte> encodedParameters
    Overrides
    CpECDsa.ImportPublicKey(ReadOnlySpan<byte>, ReadOnlySpan<byte>)

    ImportSubjectPublicKeyInfo(ReadOnlySpan<byte>, out int)

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

    Declaration
    public override void ImportSubjectPublicKeyInfo(ReadOnlySpan<byte> source, out int bytesRead)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> source

    The bytes of an X.509 SubjectPublicKeyInfo structure in the ASN.1-DER encoding.

    int bytesRead

    When this method returns, contains a value that indicates the number of bytes read from source. This parameter is treated as uninitialized.

    Overrides
    AsymmetricAlgorithm.ImportSubjectPublicKeyInfo(ReadOnlySpan<byte>, out int)
    Exceptions
    Type Condition
    CryptographicException

    The contents of source do not represent an ASN.1-DER-encoded X.509 SubjectPublicKeyInfo structure.

    -or-

    The contents of source indicate the key is for an algorithm other than the algorithm represented by this instance.

    -or-

    The contents of source represent the key in a format that is not supported.

    -or-

    The algorithm-specific key import failed.

    NotImplementedException

    A derived type has not overriden this member.

    SignHash(byte[], string?)

    Computes the hash value of a subset of the specified byte array using the specified hash algorithm, and signs the resulting hash value.

    Declaration
    public byte[] SignHash(byte[] rgbHash, string? str)
    Parameters
    Type Name Description
    byte[] rgbHash

    The input data for which to compute the hash

    string str

    The hash algorithm to use to create the hash value.

    Returns
    Type Description
    byte[]

    The ECDSA signature for the specified data.

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

    Declaration
    protected override bool TrySignHashCore(ReadOnlySpan<byte> rgbHash, Span<byte> signature, CpHashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat, out int bytesWritten)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> rgbHash
    Span<byte> signature
    CpHashAlgorithmName hashAlgorithm
    DSASignatureFormat signatureFormat
    int bytesWritten
    Returns
    Type Description
    bool
    Overrides
    CpECDsa.TrySignHashCore(ReadOnlySpan<byte>, Span<byte>, CpHashAlgorithmName, DSASignatureFormat, out int)

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

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

    Declaration
    protected override bool VerifyHashCore(ReadOnlySpan<byte> rgbHash, ReadOnlySpan<byte> rgbSignature, CpHashAlgorithmName hashAlgorithmName, DSASignatureFormat signatureFormat)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> rgbHash
    ReadOnlySpan<byte> rgbSignature
    CpHashAlgorithmName hashAlgorithmName
    DSASignatureFormat signatureFormat
    Returns
    Type Description
    bool

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

    Overrides
    CpECDsa.VerifyHashCore(ReadOnlySpan<byte>, ReadOnlySpan<byte>, CpHashAlgorithmName, DSASignatureFormat)
    Exceptions
    Type Condition
    CryptographicException

    An error occurred in the verification operation.

    Implements

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