AesGcm 建構函式

定義

多載

AesGcm(Byte[])
已淘汰.

使用提供的金鑰,初始化 AesGcm 類別的新執行個體。

AesGcm(ReadOnlySpan<Byte>)
已淘汰.

使用提供的金鑰,初始化 AesGcm 類別的新執行個體。

AesGcm(Byte[], Int32)

使用提供的索引鍵和必要的標籤大小, AesGcm 初始化 類別的新實例。

AesGcm(ReadOnlySpan<Byte>, Int32)

使用提供的索引鍵和必要的標籤大小, AesGcm 初始化 類別的新實例。

AesGcm(Byte[])

來源:
AesGcm.cs
來源:
AesGcm.cs
來源:
AesGcm.cs

警告

AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.

使用提供的金鑰,初始化 AesGcm 類別的新執行個體。

public:
 AesGcm(cli::array <System::Byte> ^ key);
public AesGcm (byte[] key);
[System.Obsolete("AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.", DiagnosticId="SYSLIB0053", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public AesGcm (byte[] key);
new System.Security.Cryptography.AesGcm : byte[] -> System.Security.Cryptography.AesGcm
[<System.Obsolete("AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.", DiagnosticId="SYSLIB0053", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.AesGcm : byte[] -> System.Security.Cryptography.AesGcm
Public Sub New (key As Byte())

參數

key
Byte[]

要用於這個執行個體的祕密金鑰。

屬性

例外狀況

key 參數為 null

key 參數長度是 16、24 或 32 個位元組 (128、192 或 256 位元) 以外的長度。

適用於

AesGcm(ReadOnlySpan<Byte>)

來源:
AesGcm.cs
來源:
AesGcm.cs
來源:
AesGcm.cs

警告

AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.

使用提供的金鑰,初始化 AesGcm 類別的新執行個體。

public:
 AesGcm(ReadOnlySpan<System::Byte> key);
public AesGcm (ReadOnlySpan<byte> key);
[System.Obsolete("AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.", DiagnosticId="SYSLIB0053", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public AesGcm (ReadOnlySpan<byte> key);
new System.Security.Cryptography.AesGcm : ReadOnlySpan<byte> -> System.Security.Cryptography.AesGcm
[<System.Obsolete("AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.", DiagnosticId="SYSLIB0053", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.AesGcm : ReadOnlySpan<byte> -> System.Security.Cryptography.AesGcm
Public Sub New (key As ReadOnlySpan(Of Byte))

參數

key
ReadOnlySpan<Byte>

要用於這個執行個體的祕密金鑰。

屬性

例外狀況

key 參數長度是 16、24 或 32 個位元組 (128、192 或 256 位元) 以外的長度。

適用於

AesGcm(Byte[], Int32)

來源:
AesGcm.cs
來源:
AesGcm.cs

使用提供的索引鍵和必要的標籤大小, AesGcm 初始化 類別的新實例。

public:
 AesGcm(cli::array <System::Byte> ^ key, int tagSizeInBytes);
public AesGcm (byte[] key, int tagSizeInBytes);
new System.Security.Cryptography.AesGcm : byte[] * int -> System.Security.Cryptography.AesGcm
Public Sub New (key As Byte(), tagSizeInBytes As Integer)

參數

key
Byte[]

要用於這個執行個體的祕密金鑰。

tagSizeInBytes
Int32

標籤的大小,以位元組為單位,該加密和解密必須使用。

例外狀況

key 參數為 null

key 參數長度是 16、24 或 32 個位元組 (128、192 或 256 位元) 以外的長度。

參數 tagSizeInBytes 是 所 TagByteSizes 指示的不受支援的標籤大小。

目前的平臺不支援 AES-GCM。

備註

參數 tagSizeInBytes 是用來指出 或 Decrypt 中的 Encrypt 標記參數必須完全是這個大小。 指出必要的標籤大小可防止呼叫端 Decrypt 提供標籤作為輸入,且該輸入被截斷為非預期的大小的問題。

適用於

AesGcm(ReadOnlySpan<Byte>, Int32)

來源:
AesGcm.cs
來源:
AesGcm.cs

使用提供的索引鍵和必要的標籤大小, AesGcm 初始化 類別的新實例。

public:
 AesGcm(ReadOnlySpan<System::Byte> key, int tagSizeInBytes);
public AesGcm (ReadOnlySpan<byte> key, int tagSizeInBytes);
new System.Security.Cryptography.AesGcm : ReadOnlySpan<byte> * int -> System.Security.Cryptography.AesGcm
Public Sub New (key As ReadOnlySpan(Of Byte), tagSizeInBytes As Integer)

參數

key
ReadOnlySpan<Byte>

要用於這個執行個體的祕密金鑰。

tagSizeInBytes
Int32

標籤的大小,以位元組為單位,該加密和解密必須使用。

例外狀況

key 參數長度是 16、24 或 32 個位元組 (128、192 或 256 位元) 以外的長度。

參數 tagSizeInBytes 是 所 TagByteSizes 指示的不受支援的標籤大小。

目前的平臺不支援 AES-GCM。

備註

參數 tagSizeInBytes 是用來指出 或 Decrypt 中的 Encrypt 標記參數必須完全是這個大小。 指出必要的標籤大小可防止呼叫端 Decrypt 提供標籤作為輸入,且該輸入被截斷為非預期的大小的問題。

適用於