The Bouncy Castle Diffie-Hellman documentation speaks of using "user keying material" and a KDF when deriving ephemeral keys from a static long term key pair. There is no mention of how to generate this key material.
For example, in BCFipsIn100.pdf, they have this example:
public static byte[] initiatorAgreementWithKdf(PrivateKey initiatorPrivate, PublicKey recipientPublic, byte[] userKeyingMaterial) throws GeneralSecurityException {
KeyAgreement agreement = KeyAgreement.getInstance("ECCDHwithSHA384CKDF", "BCFIPS");
agreement.init(initiatorPrivate, new UserKeyingMaterialSpec(userKeyingMaterial));
agreement.doPhase(recipientPublic, true);
SecretKey agreedKey = agreement.generateSecret("AES[256]");
return agreedKey.getEncoded();
}
Their examples use static strings for userKeyingMaterial, but make no mention of generally what this is supposed to be.
What are the specifications on how to generate userKeyingMaterial? Can it be a single static string like their examples or is it essentially a nonce? What length? Can it be shared publicly when the parties exchange their public keys?