語言

AesGcm 建構函式

定義

初始化 AesGcm 類別的新執行個體。

多載

名稱 Description
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.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);
[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);
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}")>]
new System.Security.Cryptography.AesGcm : byte[] -> System.Security.Cryptography.AesGcm
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.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);
[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);
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}")>]
new System.Security.Cryptography.AesGcm : ReadOnlySpan<byte> -> System.Security.Cryptography.AesGcm
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.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用來表示標籤參數EncryptDecrypt必須正好是這個大小。 標示所需標籤大小可避免呼叫者 Decrypt 輸入標籤時,該輸入被截斷到意想不到的大小。

適用於

AesGcm(ReadOnlySpan<Byte>, Int32)

來源:
AesGcm.cs
來源:
AesGcm.cs
來源:
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用來表示標籤參數EncryptDecrypt必須正好是這個大小。 標示所需標籤大小可避免呼叫者 Decrypt 輸入標籤時,該輸入被截斷到意想不到的大小。

適用於