Share via


AesCng.Key 屬性

定義

取得或設定 AesCng 演算法的金鑰。

public:
 virtual property cli::array <System::Byte> ^ Key { cli::array <System::Byte> ^ get(); void set(cli::array <System::Byte> ^ value); };
public override byte[] Key { get; set; }
member this.Key : byte[] with get, set
Public Overrides Property Key As Byte()

屬性值

Byte[]

AesCng 演算法的金鑰。

備註

如果您已使用現有的保存索引鍵建立 AesCng 物件,當您讀取 屬性的值 Key 時,將會嘗試匯出金鑰。 在此情況下,如果索引鍵無法匯出, CryptographicException 將會擲回 。

此外,如果您設定 屬性的值,將不會再使用保存的 Key 索引鍵,並改用暫存索引鍵。 如果您需要再次使用保存的 AesCng 金鑰,則必須建立 類別的新實例。

適用於