dotfiles
bugabingas dorkfiles
owned by admin
pi/agent/skills/optional/java/java-kdf-api/examples/jep-510.md
RawRendered preview
Source: https://openjdk.org/jeps/510
KDF hkdf = KDF.getInstance("HKDF-SHA256");
AlgorithmParameterSpec params = HKDFParameterSpec.ofExtract()
.addIKM(initialKeyMaterial)
.addSalt(salt)
.thenExpand(info, 32);
SecretKey key = hkdf.deriveKey("AES", params);
# [JEP 510](https://openjdk.org/jeps/510) example
Source: https://openjdk.org/jeps/510
```java
KDF hkdf = KDF.getInstance("HKDF-SHA256");
AlgorithmParameterSpec params = HKDFParameterSpec.ofExtract()
.addIKM(initialKeyMaterial)
.addSalt(salt)
.thenExpand(info, 32);
SecretKey key = hkdf.deriveKey("AES", params);
```