KeyDerivationAlgorithmProvider KeyDerivationAlgorithmProvider KeyDerivationAlgorithmProvider KeyDerivationAlgorithmProvider Class

Represents a key derivation algorithm provider.

Syntax

Declaration

public sealed class KeyDerivationAlgorithmProviderpublic sealed class KeyDerivationAlgorithmProviderPublic NotInheritable Class KeyDerivationAlgorithmProviderpublic sealed class KeyDerivationAlgorithmProvider

Remarks

When two or more parties share a secret symmetric key, it is often necessary to derive additional keys for use in cryptographic operations. It is also often necessary for a trusted third party to derive distinct cryptographic keys from a single master key. Key derivation functions are used to derive these additional keys.

You can use the static DeriveKeyMaterial(CryptographicKey, KeyDerivationParameters, UInt32) method in the CryptographicEngine class and the following methods in the KeyDerivationParameters class to derive a key.

MethodDescription
BuildForPbkdf2(IBuffer, UInt32) Creates a KeyDerivationParameters object for use in the password-based key derivation function 2 (PBKDF2).
BuildForSP800108(IBuffer, IBuffer) Creates a KeyDerivationParameters object for use in a counter mode, hash-based message authentication code (HMAC) key derivation function.
BuildForSP80056a(IBuffer, IBuffer, IBuffer, IBuffer, IBuffer) Creates a KeyDerivationParameters object for use in the SP800-56A key derivation function.

You create a KeyDerivationAlgorithmProvider object by calling the static OpenAlgorithm(String) method.

Examples

[!code-csharpKdfAlgClassOverview]

Properties summary

Gets the name of the open key derivation function (KDF) algorithm.

Methods summary

Creates a KDF key.

Creates an instance of the KeyDerivationAlgorithmProvider class and opens the specified algorithm for use.

Properties

  • AlgorithmName
    AlgorithmName
    AlgorithmName
    AlgorithmName

    Gets the name of the open key derivation function (KDF) algorithm.

    public string AlgorithmName { get; }public string AlgorithmName { get; }Public ReadOnly Property AlgorithmName As stringpublic string AlgorithmName { get; }

    Property Value

    • string
      string
      string
      string

      Algorithm name.

    Remarks

    You must call the OpenAlgorithm(String) method before calling this property.

Methods

  • CreateKey(IBuffer)
    CreateKey(IBuffer)
    CreateKey(IBuffer)
    CreateKey(IBuffer)

    Creates a KDF key.

    public CryptographicKey CreateKey(IBuffer keyMaterial)public CryptographicKey CreateKey(IBuffer keyMaterial)Public Function CreateKey(keyMaterial As IBuffer) As CryptographicKeypublic CryptographicKey CreateKey(IBuffer keyMaterial)

    Parameters

    Returns

  • OpenAlgorithm(String)
    OpenAlgorithm(String)
    OpenAlgorithm(String)
    OpenAlgorithm(String)

    Creates an instance of the KeyDerivationAlgorithmProvider class and opens the specified algorithm for use.

    public static KeyDerivationAlgorithmProvider OpenAlgorithm(String algorithm)public static KeyDerivationAlgorithmProvider OpenAlgorithm(String algorithm)Public Static Function OpenAlgorithm(algorithm As String) As KeyDerivationAlgorithmProviderpublic static KeyDerivationAlgorithmProvider OpenAlgorithm(String algorithm)

    Parameters

    • algorithm
      System.String
      System.String
      System.String
      System.String

      Represents a KDF algorithm provider.

    Returns

    Remarks

    You can retrieve the algorithm name by using the AlgorithmName property. You can specify the name of the algorithm by using the static properties in the KeyDerivationAlgorithmNames class.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Security.Cryptography.Core.dll