KeyedHashAlgorithm.Key Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the key to use in the hash algorithm.
public:
virtual property cli::array <System::Byte> ^ Key { cli::array <System::Byte> ^ get(); void set(cli::array <System::Byte> ^ value); };
public virtual byte[] Key { get; set; }
member this.Key : byte[] with get, set
Public Overridable Property Key As Byte()
The key to use in the hash algorithm.
An attempt was made to change the Key property after hashing has begun.
The following code example demonstrates how to override the Key property to retrieve the key used in the current KeyedHashAlgorithm object. This code example is part of a larger example provided for the KeyedHashAlgorithm class.
virtual array<Byte>^ get() override
{
return dynamic_cast<array<Byte>^>(keyedCrypto->Key->Clone());
}
virtual void set( array<Byte>^value ) override
{
keyedCrypto->Key = dynamic_cast<array<Byte>^>(value->Clone());
}
}
public override byte[] Key
{
get
{
return (byte[]) keyedCrypto.Key.Clone();
}
set
{
keyedCrypto.Key = (byte[]) value.Clone();
}
}
Public Overrides Property Key() As Byte()
Get
Return CType(keyedCrypto.Key.Clone(), Byte())
End Get
Set(ByVal Value As Byte())
keyedCrypto.Key = CType(Value.Clone(), Byte())
End Set
End Property
This property is the public accessor for the KeyValue field.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: