log.debug("KeyDerivator: deriving key from contecxt :" + convSession.getContextInfo().getIdentifier() + " for dkt: " + dkInfo.getId());
byte[] secret = convSession.getContextInfo().getSharedSecret(); //Shared secret
String labelAndNonce = getLabelAndNonce(convSession, dkInfo); //Label and nonce
long keyLength = getKeyLength(convSession, dkInfo); //Length of the key to generated
int offset = getOffset(convSession, dkInfo);
DerivationAlgorithm derivationAlgo = AlgoFactory.getInstance(dkInfo.
getAlgorithm()); //Derivation algorithm
return derivationAlgo.createKey(secret, labelAndNonce, offset, keyLength);
}