Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Security.​Cryptography.​SP800108HmacCounterKdf
Assembly: System.Security.Cryptography
Inheritance: object → SP800108HmacCounterKdf
Implemented Interfaces
NIST SP 800-108 HMAC CTR Key-Based Key Derivation (KBKDF)
Methods
public static
byte[]
DeriveBytes​(byte[] key,
HashAlgorithmName hashAlgorithm,
byte[] label,
byte[] context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public static
byte[]
DeriveBytes​(byte[] key,
HashAlgorithmName hashAlgorithm,
string label,
string context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public static
byte[]
DeriveBytes​(ReadOnlySpan<​byte> key,
HashAlgorithmName hashAlgorithm,
ReadOnlySpan<​byte> label,
ReadOnlySpan<​byte> context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public static
void
DeriveBytes​(ReadOnlySpan<​byte> key,
HashAlgorithmName hashAlgorithm,
ReadOnlySpan<​byte> label,
ReadOnlySpan<​byte> context,
Span<​byte> destination)
Fills a buffer with a derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
destination
The buffer which will receive the derived key.
public static
byte[]
DeriveBytes​(ReadOnlySpan<​byte> key,
HashAlgorithmName hashAlgorithm,
ReadOnlySpan<​char> label,
ReadOnlySpan<​char> context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public static
void
DeriveBytes​(ReadOnlySpan<​byte> key,
HashAlgorithmName hashAlgorithm,
ReadOnlySpan<​char> label,
ReadOnlySpan<​char> context,
Span<​byte> destination)
Fills a buffer with a derived key.
key
The key-derivation key.
hashAlgorithm
The HMAC algorithm.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
destination
The buffer which will receive the derived key.
public
byte[]
DeriveKey​(byte[] label,
byte[] context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public
byte[]
DeriveKey​(ReadOnlySpan<​byte> label,
ReadOnlySpan<​byte> context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public
void
DeriveKey​(ReadOnlySpan<​byte> label,
ReadOnlySpan<​byte> context,
Span<​byte> destination)
Fills a buffer with a derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
destination
The buffer which will receive the derived key.
public
byte[]
DeriveKey​(ReadOnlySpan<​char> label,
ReadOnlySpan<​char> context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public
void
DeriveKey​(ReadOnlySpan<​char> label,
ReadOnlySpan<​char> context,
Span<​byte> destination)
Fills a buffer with a derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
destination
The buffer which will receive the derived key.
public
byte[]
DeriveKey​(string label,
string context,
int derivedKeyLengthInBytes)
Derives a key of a specified length.
Returns An array containing the derived key.
label
The label that identifies the purpose for the derived key.
context
The context containing information related to the derived key.
derivedKeyLengthInBytes
The length of the derived key, in bytes.
public
void
Dispose​()
Releases all resources used by the current instance of <see cref="T:System.Security.Cryptography.SP800108HmacCounterKdf" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object