Class DSACryptoServiceProvider
Предоставляет методы для шифрования текста с открытым ключом по алгоритму DSA.
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
[ComVisible(true)]
public class DSACryptoServiceProvider : IDisposable
Constructors
DSACryptoServiceProvider()
Инициализирует заданный экземпляр DSACryptoServiceProvider.
Declaration
public DSACryptoServiceProvider()
Properties
KeyContainerName
Имя владельца ключа.
Declaration
public string KeyContainerName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
KeySize
Размер ключа в битах.
Declaration
public int KeySize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PrivateKey
Значение закрытого ключа.
Declaration
public string PrivateKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PublicKey
Значение публичного ключа.
Declaration
public string PublicKey { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Close()
Declaration
[Obsolete("7.14.3 | Method is not in use and will be removed in upcoming releases")]
public void Close()
ConvertToBase64String(String, DSASignatureFormatter)
Declaration
protected string ConvertToBase64String(string data, DSASignatureFormatter signatureFormatter)
Parameters
Type | Name | Description |
---|---|---|
System.String | data | |
System.Security.Cryptography.DSASignatureFormatter | signatureFormatter |
Returns
Type | Description |
---|---|
System.String |
Dispose()
Выполняет удаление, высвобождение и сброс ресурсов. Отменяет вызов Finalize() для данного экземпляра.
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
SignData(String, String)
Выполняет шифрование заданного текста с заданным секретным ключом.
Declaration
public virtual string SignData(string data, string privateKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | data | Текст для шифрования. |
System.String | privateKey | Секретный ключ. |
Returns
Type | Description |
---|---|
System.String | Строка, представляющая зашифрованный текст в формате base64. |
VerifyData(String, String, String)
Выполняет проверку заданного зашифрованного текста с заданным публичным ключом.
Declaration
public virtual bool VerifyData(string data, string signedData, string publicKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | data | Эталон проверки. |
System.String | signedData | Зашифрованный текст в формате base64. |
System.String | publicKey | Публичный ключ. |
Returns
Type | Description |
---|---|
System.Boolean |
VerifySignature(String, String, DSASignatureDeformatter)
Declaration
protected bool VerifySignature(string data, string signedData, DSASignatureDeformatter signatureDeformatter)
Parameters
Type | Name | Description |
---|---|---|
System.String | data | |
System.String | signedData | |
System.Security.Cryptography.DSASignatureDeformatter | signatureDeformatter |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
System.IDisposable