Package net.i2p.crypto
Class HKDF
java.lang.Object
net.i2p.crypto.HKDF
public final class HKDF extends Object
Various flavors of HKDF using HMAC-SHA256.
 See RFC 5869.
 One or two outputs, with or without "info".
 All keys and outputs are exactly 32 bytes.
- Since:
- 0.9.38
- 
Constructor SummaryConstructors Constructor Description HKDF(I2PAppContext context)Thread safe, no state, can be reused
- 
Method SummaryModifier and Type Method Description voidcalculate(byte[] key, byte[] data, byte[] out)One output, no info.voidcalculate(byte[] key, byte[] data, byte[] out, byte[] out2, int off2)Two outputs, no info.voidcalculate(byte[] key, byte[] data, String info, byte[] out)One output with info.voidcalculate(byte[] key, byte[] data, String info, byte[] out, byte[] out2, int off2)Two outputs with info.
- 
Constructor Details- 
HKDFThread safe, no state, can be reused
 
- 
- 
Method Details- 
calculatepublic void calculate(byte[] key, byte[] data, byte[] out)One output, no info.- Parameters:
- key- first 32 bytes used as the key
- out- must be exactly 32 bytes
 
- 
calculateOne output with info.- Parameters:
- key- first 32 bytes used as the key
- info- non-null ASCII, "" if none
- out- must be exactly 32 bytes
 
- 
calculatepublic void calculate(byte[] key, byte[] data, byte[] out, byte[] out2, int off2)Two outputs, no info.- Parameters:
- key- first 32 bytes used as the key
- out- 32 bytes will be copied to here
- out2- 32 bytes will be copied to here, may be the same as out
- off2- offset for copy to out2
 
- 
calculateTwo outputs with info.- Parameters:
- key- first 32 bytes used as the key
- info- non-null ASCII, "" if none
- out- 32 bytes will be copied to here
- out2- 32 bytes will be copied to here, may be the same as out
- off2- offset for copy to out2
 
 
-