Package org.jose4j.jwe.kdf
Class ConcatKeyDerivationFunction
java.lang.Object
org.jose4j.jwe.kdf.ConcatKeyDerivationFunction
- All Implemented Interfaces:
ConcatenationKeyDerivationFunctionWithSha256
public class ConcatKeyDerivationFunction
extends Object
implements ConcatenationKeyDerivationFunctionWithSha256
An implementation of Concatenation Key Derivation Function (aka Concat KDF or ConcatKDF)
from Section 5.8.1 of National Institute of Standards and Technology (NIST),
"Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography",
NIST Special Publication 800-56A, Revision 2, May 2013.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final org.slf4j.Loggerprivate MessageDigest -
Constructor Summary
ConstructorsConstructorDescriptionConcatKeyDerivationFunction(String hashAlgoritm) ConcatKeyDerivationFunction(String hashAlgoritm, String provider) -
Method Summary
Modifier and TypeMethodDescription(package private) longgetReps(int keydatalen) private voidinit()byte[]kdf(byte[] sharedSecret, int keydatalen, byte[] otherInfo) byte[]kdf(byte[] sharedSecret, int keydatalen, byte[] algorithmId, byte[] partyUInfo, byte[] partyVInfo, byte[] suppPubInfo, byte[] suppPrivInfo) private booleantraceLog()
-
Field Details
-
log
private static final org.slf4j.Logger log -
digestLength
private int digestLength -
messageDigest
-
-
Constructor Details
-
ConcatKeyDerivationFunction
-
ConcatKeyDerivationFunction
-
-
Method Details
-
init
private void init() -
kdf
public byte[] kdf(byte[] sharedSecret, int keydatalen, byte[] algorithmId, byte[] partyUInfo, byte[] partyVInfo, byte[] suppPubInfo, byte[] suppPrivInfo) -
kdf
public byte[] kdf(byte[] sharedSecret, int keydatalen, byte[] otherInfo) - Specified by:
kdfin interfaceConcatenationKeyDerivationFunctionWithSha256
-
getReps
long getReps(int keydatalen) -
traceLog
private boolean traceLog()
-