public class ConcatKDF extends Object implements DerivationAlgorithm
Identifier of the key derivation algorithm: http://www.w3.org/2009/xmlenc11#ConcatKDF
| Constructor and Description |
|---|
ConcatKDF()
Default Constructor which sets the default digest algorithmURI parameter: http://www.w3.org/2001/04/xmlenc#sha256,
|
ConcatKDF(String algorithmURI)
Constructor ConcatKDF with digest algorithmURI parameter such as http://www.w3.org/2001/04/xmlenc#sha256,
http://www.w3.org/2001/04/xmlenc#sha512, etc.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
deriveKey(byte[] secret,
byte[] otherInfo,
int offset,
long keyLength)
Key DerivationAlgorithm implementation as defined in Section 5.8.1 of NIST SP 800-56A [SP800-56A]
reps = ⎡ keydatalen / hashlen⎤.
If reps > (2>32 −1), then ABORT: output an error indicator and stop.
Initialize a 32-bit, big-endian bit string counter as 0000000116.
If counter || Z || OtherInfo is more than max_hash_inputlen bits long, then ABORT: output an error indicator and stop.
|
byte[] |
deriveKey(byte[] sharedSecret,
String algID,
String partyUInfo,
String partyVInfo,
String suppPubInfo,
String suppPrivInfo,
long keyLength)
Method concatenate the bitstrings in following order
algID || partyUInfo || partyVInfo || suppPubInfo || suppPrivInfo. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitderiveKeypublic ConcatKDF(String algorithmURI)
public ConcatKDF()
public byte[] deriveKey(byte[] secret,
byte[] otherInfo,
int offset,
long keyLength)
throws XMLSecurityException
deriveKey in interface DerivationAlgorithmsecret - The "shared" secret to use for key derivation (e.g. the secret key)otherInfo - as specified in [SP800-56A] the optional attributes: AlgorithmID, PartyUInfo, PartyVInfo, SuppPubInfo and SuppPrivInfo attributes are concatenated to form a bit string “OtherInfo” that is used with the key derivation function.offset - the offset parameter is ignored by this implementation.keyLength - The length of the key to deriveXMLEncryptionException - if the key length is too long to be derived with the given algorithmXMLSecurityException - if something goes wrong during the key derivationpublic byte[] deriveKey(byte[] sharedSecret,
String algID,
String partyUInfo,
String partyVInfo,
String suppPubInfo,
String suppPrivInfo,
long keyLength)
throws XMLSecurityException
algID || partyUInfo || partyVInfo || suppPubInfo || suppPrivInfo.
to crate otherInfo as key derivation function input.
If named parameters are null the value is ignored.
Method parses the bitstring firs {@See https://www.w3.org/TR/xmlenc-core1/#sec-ConcatKDF} and then concatenates them to a byte array.sharedSecret - The "shared" secret to use for key derivation (e.g. the secret key)algID - A bit string that indicates how the derived keying material will be parsed and for which
algorithm(s) the derived secret keying material will be used.partyUInfo - A bit string containing public information that is required by the
application using this KDF to be contributed by party U to the key derivation
process. At a minimum, PartyUInfo shall include IDU, the identifier of party U. See
the notes below..partyVInfo - A bit string containing public information that is required by the
application using this KDF to be contributed by party V to the key derivation
process. At a minimum, PartyVInfo shall include IDV, the identifier of party V. See
the notes below.suppPubInfo - bit string containing additional, mutually-known public information.suppPrivInfo - The suppPrivInfo A bit string containing additional, mutually-known public Information.keyLength - The length of the key to deriveXMLSecurityExceptionCopyright © 2000–2024 The Apache Software Foundation. All rights reserved.