public class KBKDFParameterSpec
extends java.lang.Object
implements java.security.spec.AlgorithmParameterSpec
KDF.getInstance("KBKDF-COUNTER-HMACSHA256"), "KBKDF-FEEDBACK-HMACSHA256",
"KBKDF-PIPELINE-HMACSHA256", ...): the input key K_IN, the fixed input data, the output length, the
counter length and, for feedback mode, the IV.
The KBKDFParameterSpec(byte[], byte[], byte[], int) constructor builds the fixed input data in
the layout the standard's Section 4 suggests, Label || 0x00 || Context || [L]_32 with L the output length
in bits, and uses a 32-bit counter. The counter precedes the fixed input data in counter mode, and
follows the chaining value in feedback and double-pipeline mode; a counter length of 0 omits the
counter in those two modes, as the standard allows.
| Constructor and Description |
|---|
KBKDFParameterSpec(byte[] keyIn,
byte[] label,
byte[] context,
int outputLength)
The standard layout: Label || 0x00 || Context || [L]_32, with a 32-bit counter.
|
KBKDFParameterSpec(byte[] keyIn,
byte[] fixedInputData,
int outputLength,
int counterBits)
Caller-supplied fixed input data.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCounterBits() |
byte[] |
getFixedInputData() |
byte[] |
getIV() |
byte[] |
getKeyIn() |
int |
getOutputLength() |
KBKDFParameterSpec |
withIV(byte[] iv)
Return a copy of this spec with the IV feedback mode chains from.
|
public KBKDFParameterSpec(byte[] keyIn,
byte[] label,
byte[] context,
int outputLength)
keyIn - the input key K_IN.label - the label, may be null.context - the context, may be null.outputLength - the number of bytes to derive.public KBKDFParameterSpec(byte[] keyIn,
byte[] fixedInputData,
int outputLength,
int counterBits)
keyIn - the input key K_IN.fixedInputData - the fixed input data, may be null.outputLength - the number of bytes to derive.counterBits - the counter length in bits: 8, 16, 24 or 32, or 0 for no counter (feedback and
double-pipeline mode only).public KBKDFParameterSpec withIV(byte[] iv)
iv - the IV, may be null for an empty IV.public byte[] getKeyIn()
public byte[] getFixedInputData()
public int getOutputLength()
public int getCounterBits()
public byte[] getIV()