DSACng Construtores
Definição
Sobrecargas
| DSACng() |
Inicializa uma nova instância da classe DSACng com um par de chaves aleatório de 2.048 bits.Initializes a new instance of the DSACng class with a random 2,048-bit key pair. |
| DSACng(Int32) |
Inicializa uma nova instância da classe DSACng com uma chave gerada aleatoriamente do tamanho especificado.Initializes a new instance of the DSACng class with a randomly generated key of the specified size. |
| DSACng(CngKey) |
Inicializa uma nova instância da classe DSACng com a chave especificada.Initializes a new instance of the DSACng class with the specified key. |
DSACng()
DSACng(Int32)
public:
DSACng(int keySize);
public DSACng (int keySize);
new System.Security.Cryptography.DSACng : int -> System.Security.Cryptography.DSACng
Public Sub New (keySize As Integer)
Parâmetros
- keySize
- Int32
O tamanho da chave a ser gerada em bits.The size of the key to generate in bits.
Exceções
keySize não é válido.keySize is not valid.
Comentários
Os tamanhos de chave válidos variam de 512 a 3.072 bits, em incrementos de 64.Valid key sizes range from 512 to 3,072 bits, in increments of 64. É recomendável que um tamanho mínimo de 2.048 bits seja usado para todas as chaves.We recommend that a minimum size of 2,048 bits be used for all keys.
Importante
Os criadores do algoritmo DSA retiraram seu suporte para ele.The creators of the DSA algorithm have withdrawn their support for it. Considere usar a classe RSA ou a ECDsa classe em vez da DSA classe.Consider using the RSA class or the ECDsa class instead of the DSA class. Use DSA apenas para compatibilidade com dados e aplicativos herdados.Use DSA only for compatibility with legacy applications and data.
Aplica-se a
DSACng(CngKey)
public:
DSACng(System::Security::Cryptography::CngKey ^ key);
public DSACng (System.Security.Cryptography.CngKey key);
new System.Security.Cryptography.DSACng : System.Security.Cryptography.CngKey -> System.Security.Cryptography.DSACng
Public Sub New (key As CngKey)
Parâmetros
- key
- CngKey
A chave a ser usada para as operações de DSA.The key to use for DSA operations.
Exceções
key não é uma chave DSA válida.key is not a valid DSA key.
key é null.key is null.
Comentários
O CngKey.AlgorithmGroup de key deve ser CngAlgorithmGroup.Dsa .The CngKey.AlgorithmGroup of key must be CngAlgorithmGroup.Dsa.
Esse construtor cria uma cópia da chave.This constructor creates a copy of the key. Mesmo se key for descartado, a cópia desse objeto de chave no DSA permanecerá ativa.Even if key is disposed, the copy of this key object in DSA remains alive.