System.currentTimeMillis() ) / 1000 );
setExpire(expiryIn);
if (type.getHAlgorithm() != null) // DH session, encrypt the MAC key
{
DiffieHellmanSession dhSess = DiffieHellmanSession.create(
type, assocReq.getDhModulus(), assocReq.getDhGen() );
setPublicKey(dhSess.getPublicKey());
setMacKeyEnc(dhSess.encryptMacKey(
assoc.getMacKey().getEncoded(),
assocReq.getDhPublicKey() ));
}
else // no-encryption session, unecrypted MAC key
{