Share via


SymmetricSignatureProvider.GetKeyBytes(SecurityKey) Method

Definition

Called to obtain the byte[] needed to create a KeyedHashAlgorithm

protected virtual byte[] GetKeyBytes (Microsoft.IdentityModel.Tokens.SecurityKey key);
abstract member GetKeyBytes : Microsoft.IdentityModel.Tokens.SecurityKey -> byte[]
override this.GetKeyBytes : Microsoft.IdentityModel.Tokens.SecurityKey -> byte[]
Protected Overridable Function GetKeyBytes (key As SecurityKey) As Byte()

Parameters

key
SecurityKey

SecurityKeythat will be used to obtain the byte[].

Returns

Byte[]

Byte[] that is used to populated the KeyedHashAlgorithm.

Exceptions

if key is null.

if a byte[] can not be obtained from SecurityKey.

Remarks

SymmetricSecurityKey and JsonWebKey are supported.

For a SymmetricSecurityKey .Key is returned

For a JsonWebKeyBase64UrlEncoder.DecodeBytes is called with K if Kty == JsonWebAlgorithmsKeyTypes.Octet

Applies to