Derive an EC private key in a deterministic manner from input keying material using the DeriveKeyPair algorithm in RFC9180.
public static string DerivePrivateKey( byte[] ikm, Hpke.CurveName curveName, Hpke.OutputOpts opts )
Public Shared Function DerivePrivateKey ( _ ikm As Byte(), _ curveName As Hpke.CurveName, _ opts As Hpke.OutputOpts _ ) As String
EC curve | KDF |
---|---|
P-256 | HKDF-SHA256 |
P-384 | HKDF-SHA384 |
P-521 | HKDF-SHA512 |
X25519 | HKDF-SHA256 |
X448 | HKDF-SHA512 |
string ikmhex = "7268600d403fce431561aef583ee1613527cff655c1343f29812e66706df3234"; string skhex = Hpke.DerivePrivateKey(Cnv.FromHex(ikmhex), Hpke.CurveName.X25519, Hpke.OutputOpts.KeyAsHex); // 52c4a758a802cd8b936eceea314432798d5baf2d7e9235dc084ab1b9cfa2f736
VB6/C equivalent: HPKE_DerivePrivateKey